英文:
I am stuck with train_test_split of sklearn model_selection
问题
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 时,生成的训练集将为空。请调整上述任何参数。
英文:
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)
showing the error:
> ValueError: With n_samples=0, test_size=0.2 and train_size=None, the
> resulting train set will be empty. Adjust any of the aforementioned
> parameters.
答案1
得分: 1
n_samples=0 表示你的数据集为空。请检查 image_data 变量。
英文:
n_samples=0 means that your dataset is empty. Check the image_data variable
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论