1 Star 0 Fork 43

AnserGen/beauty

forked from 夜半饿得慌/beauty 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tpot_beauty_pipeline.py 908 Bytes
一键复制 编辑 原始数据 按行查看 历史
showkeyjar 提交于 2020-03-24 08:42 . fix readme.md
import numpy as np
import pandas as pd
from sklearn.linear_model import RidgeCV
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import MaxAbsScaler
# NOTE: Make sure that the class is labeled 'target' in the data file
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features = tpot_data.drop('target', axis=1).values
training_features, testing_features, training_target, testing_target = \
train_test_split(features, tpot_data['target'].values, random_state=None)
# Average CV score on the training set was:0.5202092914422807
exported_pipeline = make_pipeline(
MaxAbsScaler(),
RidgeCV()
)
#可以随便改别人的代码?.
#可以,不过没用的就删了
exported_pipeline.fit(training_features, training_target)
results = exported_pipeline.predict(testing_features)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ansergen/beauty.git
git@gitee.com:ansergen/beauty.git
ansergen
beauty
beauty
master

搜索帮助