简体   繁体   中英

ModuleNotFoundError: No module named 'sklearn.ensemble.voting_classifier'

I am trying to load a pickle file using below code.

# Load model from file classiferM1 = joblib.load("Model 1_ensemble.pkl")

Now I am facing error ModuleNotFoundError: No module named 'sklearn.ensemble.voting_classifier'

I understand that sklearn has this module as sklearn.ensemble.VotingClassifier .

Please let me know how I can overcome this error, can I edit the pickle file code?

Thanks and Regards, Surendra.

You Have Typo mistake the original module name is VotingClassifier but you have written sklearn.ensemble.voting_classifier in your code. Change from sklearn.ensemble import voting_classifier into from sklearn.ensemble import VotingClassifier in your code..

Issue is resolved by installing Anaconda 2.7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM