-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"NotFittedError: #7
Comments
import pickle "Use this with dum and create its work" |
File "/Users/anushka/anaconda3/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script |
# importing vectorizer # create vectors of transformed text feature and then stored it in x variable # now try to train MultinomialNB(), it will work Hope you understand |
how to resolve not fitted error for the Spam classifier Project?? Anyone can please help me |
Exact what error u are facing
Please share
…On Mon, 15 Apr 2024 at 6:13 PM, Priti Samse(Government college of Enginnering,Aurangabad) ***@***.***> wrote:
how to resolve not fitted error for the Spam classifier Project?? Anyone
can please help me
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVCE43EAVYPPZHC2ZIAEN3DY5PDOZAVCNFSM6AAAAAAZH2RZQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJWG43DIMRXHE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
File Load Error for model.pkl this happen for both the files i.e. vectorizer.pkl and model.pkl |
NotFittedError: The TF-IDF vectorizer is not fitted File "C:\Users\DELL\PycharmProjects\SMS Spam Project\venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 542, in _run_script and this is the error after streamlit running |
import pandas as pd Load the datasetdata = pd.read_csv('spam.csv', encoding='latin-1') Split the datax_train, x_test, y_train, y_test = train_test_split(data['text'], data['label'], test_size=0.2, random_state=42) Fit the TF-IDF vectorizertfidf_vectorizer = TfidfVectorizer(max_features=3500) Define the classifierssvc = SVC(kernel='sigmoid', gamma=1.0, probability=True) Create a voting classifiervoting = VotingClassifier(estimators=[('svm', svc), ('nb', mnb), ('et', etc)], voting='soft') Save the trained model and vectorizerjoblib.dump(voting, 'spam_classifier.pkl') I've used joblib instead of pickle and it worked. |
Can you plz help how to sole this problem
"NotFittedError: This MultinomialNB instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator."
plz respond
The text was updated successfully, but these errors were encountered: