【发布时间】:2019-06-30 20:11:12
【问题描述】:
如果其中没有因变量,如何将数据集 (csv) 拆分为 Python 编程语言中的训练和测试数据
我目前从事的项目是基于机器学习的,数据集不包含任何依赖数据。以下代码仅在数据集包含依赖数据时才有效 -
从 sklearn.model_selection 导入 train_test_split xTrain, xTest, yTrain, yTest = train_test_split(x, y, test_size = 0.2, random_state = 0)
我希望在没有任何 'y' 变量的情况下发生拆分, 有可能吗?
【问题讨论】:
标签: python-3.x machine-learning