reiinakano / scikit-plot

An intuitive library to add plotting functionality to scikit-learn objects.
MIT License
2.43k stars 285 forks source link

Too many indices For Array #92

Open Bhisham-Sharma opened 6 years ago

Bhisham-Sharma commented 6 years ago

I am facing IndexError but i don't know why as my train and test set are in perfect shape as required by cross_val_score but still im getting this error. Any suggestions ?

K-NN for Amazon Fud Review.html.pdf

Bhisham-Sharma commented 6 years ago

check the file above in link and please help me solve this problem

mhbw commented 5 years ago

having the same problem actually, can't figure out why.

Bhisham-Sharma commented 5 years ago

I solved this problem already long ago. Actually the shape of y_labels (which is polarity_train in my PDF I provided) is not in the required shape. Either it should (1400,1) or just list of 1400 class labels. As it's in array, because I used polarity_train.shape, so it should be in two dimensional. Just reshape your class labels to (1400,1) or use list of class labels. Hope it will solve too many indices problem in this case

XT-Tahoe commented 4 years ago

I also meet with this problems. I can't solve it no matter how I change the shape of data I used. Please tell me how to solve it if you truly solved.