susanli2016 / Machine-Learning-with-Python

Python code for common Machine Learning Algorithms
4.25k stars 4.81k forks source link

dimension mismatch #24

Open ShafiqaIqbal opened 4 years ago

ShafiqaIqbal commented 4 years ago

I am trying to predict the class of a string (randomly) but the clf.predict always give dimensions mismatch error. here i am adding the very first line to check if it classifies correctly. but it displays mismatch error, i have done everything the same way mentioned in the notebook.

s = []
s.append((df['final'][0]))
print(clf.predict(count_vect.transform(s)))