【发布时间】:2020-04-24 03:44:02
【问题描述】:
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(image_data, labels, test_size = 0.2, random_state = 101)
显示错误:
ValueError:当 n_samples=0、test_size=0.2 和 train_size=None 时, 结果火车集将是空的。调整上述任何一项 参数。
【问题讨论】:
-
告诉你传入的数据好像是空的。最好检查 image_data 和标签。
-
image_data和labels的形状是什么? -
doc 说:“允许的输入是列表、numpy 数组、scipy-sparse 矩阵或 pandas 数据帧。”你应该检查输入的类型和形状
标签: python python-3.x scikit-learn