shankarpandala / lazypredict

Lazy Predict help build a lot of basic models without much code and helps understand which models works better without any parameter tuning
MIT License
2.87k stars 333 forks source link

incompatiable with Scikit-learn V0.24.2 #351

Closed kgmat closed 1 year ago

kgmat commented 3 years ago

Hello,

Facing this issue.

lazypredict 0.2.9 requires scikit-learn==0.23.1, but you have scikit-learn 0.24.2 which is incompatible.

lazypredict has to be restricted to scikit older version?

thanks

parayamelo commented 3 years ago

Same here, scikit-learn is already in version 1.0, there is no foreseable change?

NasGit3 commented 2 years ago

You are right; it is not compatible with sklearn V0.24.2. This is mainly because the location of some modules has been changed in sklearn and the required modifications have not been made to the source code in lazypredict. To fix these issues, you need to go to Supervised.py which is located at: /envs//lib/python/site-packages/lazypredict/Supervised.py then change the errors one by one according to the documentation of sklearn V0.2.24. Here, I'm listing the modifications that I made. The error you get might be different than mine. But, as I said you should use the documentation of sklearn V0.2.24 to figure out the location of the new modules:

from sklearn.utils.testing import all_estimators to from sklearn.utils import all_estimators

sklearn.ensemble.gradient_boosting.GradientBoostingClassifier to sklearn.ensemble.GradientBoostingClassifier

sklearn.gaussian_process.gpc.GaussianProcessClassifier to sklearn.gaussian_process._gpc.GaussianProcessClassifier

sklearn.neural_network.multilayer_perceptron.MLPClassifier to sklearn.neural_network.MLPClassifier

sklearn.linear_model.logistic.LogisticRegressionCV to sklearn.linear_model.LogisticRegressionCV

sklearn.neighbors.classification.RadiusNeighborsClassifier to sklearn.neighbors.RadiusNeighborsClassifier

sklearn.ensemble.voting.VotingClassifier to sklearn.ensemble.VotingClassifier

removed_regressors = [('TheilSenRegressor', sklearn.linear_model.theil_sen.TheilSenRegressor), to removed_regressors = [('TheilSenRegressor', sklearn.linear_model.TheilSenRegressor),

Finally, from the "removed_regressors" list remove the following item: ('_SigmoidCalibration', sklearn.calibration._SigmoidCalibration)

Making these changes in Supervised.py fixed my problems. Hope it helps.