1 Star 0 Fork 44

eddylapis/beauty

forked from 夜半饿得慌/beauty 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tpot_beauty_pipeline.py 838 Bytes
一键复制 编辑 原始数据 按行查看 历史
夜半饿得慌 提交于 2019-07-18 20:35 . init
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/eddylapis/beauty.git
git@gitee.com:eddylapis/beauty.git
eddylapis
beauty
beauty
master

搜索帮助