[Python]-sklearn.model_selection模块-处理数据集

拆分数据集train&test

from sklearn.model_selection import train_test_split

可以按比例拆分数据集,分为train和test

x_train, x_test, y_train, y_test = train_test_split(x, y , test_size=0.2)

x是input,y是label,test_size是想要取的测试集比例

【持续更新】
参考笔记:https://blog.csdn.net/cymy001/article/details/79078470

posted @ 2022-03-03 14:39  CAMILIA  阅读(148)  评论(0)    收藏  举报