campusx-official / sms-spam-classifier

End to end code for the email spam classifier project
97 stars 198 forks source link

Resolve error #6

Open cmd-ke opened 1 year ago

cmd-ke commented 1 year ago

How can this problem be resolved "NotFittedError: This MultinomialNB instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator."

Tried to solve but no success yet

ranaammar046 commented 1 year ago

"NotFittedError: This MultinomialNB instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator."

Tried to solve but no success yet

keshavSvishwakarma commented 1 year ago

import pickle mnb.fit(X_train,y_train) y_pred2 = mnb.predict(X_test) pickle.dump(tfidf,open('vectorizer.pkl','wb')) pickle.dump(mnb,open('model.pkl','wb'))

"Use this with dum and create its work"