philomathic-guy / Malicious-Web-Content-Detection-Using-Machine-Learning

Chrome extension for detecting phishing web sites
https://philomathic-guy.github.io/Malicious-Web-Content-Detection-Using-Machine-Learning/
MIT License
236 stars 76 forks source link

Getting Error in test.py #7

Closed NishaatK closed 5 years ago

NishaatK commented 5 years ago

Hi @rohitnaik246 , I'm referring your project. I've created random_forest.pkl using train.py but getting error in test.py: ValueError: Number of features of the model must match the input. Model n_features is 30 and input n_features is 22 error I'm using Python 2.7 and Windows 7(32 bit). How to resolve it?

philomathic-guy commented 5 years ago

The error is because the test set obtained from features_extraction.py has 22 features, whereas the model you created has 30 features. For better understanding why this has happened, can you please provide me some information about -

  1. You said you have created random_forest.pkl using train.py. What all modifications have you made to train.py?
  2. Any other changes you have made in the package?
NishaatK commented 5 years ago

Thank you for your response. The error is resolved.

On Tue, 2 Apr 2019, 12:03 pm Rohit Naik <notifications@github.com wrote:

The error is because the test set obtained from features_extraction.py has 22 features, whereas the model you created has 30 features. For better understanding why this has happened, can you please provide me some information about -

  1. You said you have created random_forest.pkl using train.py. What all modifications have you made to train.py?
  2. Any other changes you have made in the package?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rohitnaik246/Malicious-Web-Content-Detection-Using-Machine-Learning/issues/7#issuecomment-478863418, or mute the thread https://github.com/notifications/unsubscribe-auth/Au17VOvJYjp9djHYmwSC-IjyPHXQuWEbks5vcvmcgaJpZM4cUPMz .

philomathic-guy commented 5 years ago

Great. Glad I could help!