0

I am trying to train and test classification model, however, I don't understand why I am getting this error:

ValueError: The test_size = 9 should be greater or equal to the number of classes = 11

What does this error mean?

My code for splitting the datasets are the following:

# Splitting the Dataset:
X_train, _, y_train,_ = train_test_split(filtered_features_FM, y_Cat, stratify=y_Cat)
_, X_test, _, y_test = train_test_split(filtered_features_FM_T, y_T_Cat, stratify=y_T_Cat)

The error occurs at the test line.

Momo
  • 31
  • 7
  • 1
    Does this answer your question? [ValueError: n\_splits=10 cannot be greater than the number of members in each class](https://stackoverflow.com/questions/48313387/valueerror-n-splits-10-cannot-be-greater-than-the-number-of-members-in-each-cla) – Shridhar R Kulkarni Feb 28 '20 at 11:37
  • @ShridharRKulkarni So, the problem is how I split my dataset? like the split ratio? – Momo Feb 28 '20 at 11:51

0 Answers0