Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我被sklearn车型选择的列车测试分割所困扰_Python_Python 3.x_Scikit Learn - Fatal编程技术网

Python 我被sklearn车型选择的列车测试分割所困扰

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_

显示错误:

ValueError:如果n_样本=0,测试尺寸=0.2,序列尺寸=None,则 生成的列车组将为空。调整上述任何一项 参数


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)