1

I am getting an error:

ValueError: n_splits=3 cannot be greater than the number of members in each class.

In this line:

gs_clf_svm = gs_clf_svm.fit(X, y)

y.shape
Out[148]: (6,)

y
Out[149]: 
array(['Andheri East', 'Goregaon', 'Powai', 'Andheri East', 'Goregaon',
       'Powai'], dtype=object)

In the above line is details of data and shape details. Please suggest

user10468005
  • 157
  • 3
  • 11
  • What does X look like? It seems likely that is where the problem is. Take a look at https://stackoverflow.com/a/39824687/9742036 – Andrew McDowell Oct 25 '18 at 07:52

1 Answers1

0

You have only 2 members per unique class for the your target. Try set n_splits equal 2 for GridSearchCV. Or increase your dataset.

Danylo Baibak
  • 2,106
  • 1
  • 11
  • 18