我被困在sklearn model_selection的train_test_split中。

huangapple go评论68阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年1月6日 23:31:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/59614791.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定