标签: scikit-learn train-test-split
我有一个大小约为7000的数据集,其中包含2000多个不同的类。将StratifiedShuffleSplit与test_size=0.2结合使用会出现错误:
StratifiedShuffleSplit
test_size=0.2
ValueError: The test_size = 1364 should be greater or equal to the number of classes = 2030
显然不可能平衡测试集中的类,但是我最关心的是训练集中的平衡。我可以使用StratifiedShuffleSplit处理此类数据吗?