Python 我被sklearn车型选择的列车测试分割所困扰
显示错误: ValueError:如果n_样本=0,测试尺寸=0.2,序列尺寸=None,则 生成的列车组将为空。调整上述任何一项 参数Python 我被sklearn车型选择的列车测试分割所困扰,python,python-3.x,scikit-learn,Python,Python 3.x,Scikit Learn,显示错误: ValueError:如果n_样本=0,测试尺寸=0.2,序列尺寸=None,则 生成的列车组将为空。调整上述任何一项 参数 n_samples=0表示数据集为空。检查image_数据变量它告诉您传入的数据似乎为空。最好检查图像数据和标签。image\u数据和标签的形状是什么?doc说:“允许的输入是列表、numpy数组、scipy稀疏矩阵或pandas数据帧。”您应该检查输入的类型和形状 from sklearn.model_selection import train_test_
n_samples=0表示数据集为空。检查image_数据变量它告诉您传入的数据似乎为空。最好检查图像数据和标签。
image\u数据
和标签
的形状是什么?doc说:“允许的输入是列表、numpy数组、scipy稀疏矩阵或pandas数据帧。”您应该检查输入的类型和形状
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)