I have built a machine learning model to classify emails as spams or not. Now i want to test my own email and see the result. So i wrote the following code to classify the new email:
message = """Subject: Hello this is from google security team we want to recover your password. Please contact us
as soon as possible"""
message = pd.Series([message,])
transformed_message = CountVectorizer(analyzer=process_text).fit_transform(message)
proba = model.predict_proba(transformed_message)[0]
Knowing that process_text
is a function to process the email, When I run the code i get the following error:
Number of features of the model must match the input. Model n_features is 37229 and input n_features is 13
What's the problem and how can i fix that please ?