Here is my code
print(len(image_dataset.data))
print(len(phylum_target))
X_train, X_test, y_train, y_test = train_test_split(image_dataset.data, phylum_target, test_size=0.2,random_state=109)
And here is output and Error
5000
5000
Traceback (most recent call last):
File "Image_SVM_run_only.py", line 298, in <module>
X_train_temp, X_test_temp, y_train_temp, y_test_temp = train_test_split(image_dataset.data, phylum_target, test_size=0.2,random_state=109)
File "/root/anaconda3/envs/IBC/lib/python3.7/site-packages/sklearn/model_selection/_split.py", line 2127, in train_test_split
arrays = indexable(*arrays)
File "/root/anaconda3/envs/IBC/lib/python3.7/site-packages/sklearn/utils/validation.py", line 293, in indexable
check_consistent_length(*result)
File "/root/anaconda3/envs/IBC/lib/python3.7/site-packages/sklearn/utils/validation.py", line 257, in check_consistent_length
" samples: %r" % [int(l) for l in lengths])
ValueError: Found input variables with inconsistent numbers of samples: [4999, 5000]
Even though train data and test data have same length, I've got this error. Please help me T.T