Comments (6)
Those who are facing ModuleNotFoundError: No module named 'sklearn.utils.testing'
import sklearn
estimators = sklearn.utils.all_estimators(type_filter=None)
for name, class_ in estimators:
if hasattr(class_, 'predict_proba'):
print(name)
from lazypredict.
Change the sklearn version to 23.x instead of 24.x.
from lazypredict.
from sklearn.utils.testing import all_estimators
to
from sklearn.testing import all_estimators
from lazypredict.
I came across the same problem that @Rushi21-kesh mentioned. The ModuleNotFoundError
arises when removing classifiers and regressors. I solved the issue by modifying the firs couple of lines in Supervised.py
. @shankarpandala Instead of building a list of tupples (estimator_name
, sklearn.moduleX
) to remove, create a list with estimator_name
to remove, then use it in the list comprehension to remove them. This effectively makes the code run with sklearn 0.23.x and 0.24.x
removed_classifiers = [
"ClassifierChain",
"ComplementNB",
"GradientBoostingClassifier",
"GaussianProcessClassifier",
"HistGradientBoostingClassifier",
"MLPClassifier",
"LogisticRegressionCV",
"MultiOutputClassifier",
"MultinomialNB",
"OneVsOneClassifier",
"OneVsRestClassifier",
"OutputCodeClassifier",
"RadiusNeighborsClassifier",
"VotingClassifier",
]
removed_regressors = [
"TheilSenRegressor",
"ARDRegression",
"CCA",
"IsotonicRegression",
"StackingRegressor",
"MultiOutputRegressor",
"MultiTaskElasticNet",
"MultiTaskElasticNetCV",
"MultiTaskLasso",
"MultiTaskLassoCV",
"PLSCanonical",
"PLSRegression",
"RadiusNeighborsRegressor",
"RegressorChain",
"VotingRegressor",
]
CLASSIFIERS = [est for est in all_estimators() if
(issubclass(est[1], ClassifierMixin) and (est[0] not in removed_classifiers))]
REGRESSORS = [est for est in all_estimators() if
(issubclass(est[1], RegressorMixin) and (est[0] not in removed_regressors))]
from lazypredict.
Apologies, I am very new to python. I am getting the same error ModuleNotFoundError: No module named 'sklearn.utils.testing'.
Is this issue likely to be fixed in a new version soon? I am unable to install previous versions of lazypredict.
Do we know if editing the Supervised.py under the lazypredict site-packages folder fixes this? If so please could someone share the full contents of the file to update?
from lazypredict.
I have the same error and I am using sklearn 0.24.x.
user@name::~$ pip freeze | grep -i 'learn'
imbalanced-learn==0.7.0
scikit-learn==0.24.2
sklearn==0.0
umap-learn==0.5.1
user@name::~$ pip freeze | grep -i 'lazy'
lazypredict==0.2.9
from lazypredict.
Related Issues (20)
- Update documentation
- GPU support
- when running the example i get IndexError: arrays used as indices must be of integer (or boolean) type HOT 2
- Yielding Error - from lazypredict.Supervised import LazyClassifier HOT 3
- ROC-AUC calculation HOT 1
- Support for time series forecasting
- Are predictions same as models? HOT 3
- Cannot run example as shown in the docs HOT 1
- ValueError: too many values to unpack (expected 2) HOT 2
- import error HOT 2
- segmentation fault error
- Add precision to LazyClassifier HOT 1
- Boolean DataFrame incorrect shape
- Verbosity and logging HOT 1
- libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
- Stopping slow algorithms
- TypeError (OneHotEncoder) on importing LazyRegressor from lazypredict.Supervised HOT 2
- from lazypredict.Supervised import LazyClassifier - TypeError: OneHotEncoder.__init__() got an unexpected keyword argument 'sparse' HOT 7
- scikit-learn version issue HOT 3
- Classification turned into regression HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazypredict.