scikit-learn-contrib / imbalanced-learn

A Python Package to Tackle the Curse of Imbalanced Datasets in Machine Learning
https://imbalanced-learn.org
MIT License
6.85k stars 1.29k forks source link

[BUG] 'EasyEnsembleClassifier'unable to fit on Data #973

Closed ArslanKAS closed 1 year ago

ArslanKAS commented 1 year ago

Describe the bug

Whenever I try to use "'EasyEnsembleClassifier' on a dataset it throws the following error: 'EasyEnsembleClassifier' object has no attribute 'n_features_in_'

Steps/Code to Reproduce

Example:

from imblearn.ensemble import EasyEnsembleClassifier

eec =  EasyEnsembleClassifier()
eec.fit(X_train, y_train)

Versions

System: python: 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0] executable: /usr/bin/python3 machine: Linux-5.10.147+-x86_64-with-glibc2.29

Python dependencies: pip: 22.0.4 setuptools: 57.4.0 sklearn: 1.0.2 numpy: 1.22.4 scipy: 1.7.3 Cython: 0.29.33 pandas: 1.3.5 matplotlib: 3.5.3 joblib: 1.2.0 threadpoolctl: 3.1.0

Built with OpenMP: True Linux-5.10.147+-x86_64-with-glibc2.29 Python 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0] NumPy 1.22.4 SciPy 1.7.3 Scikit-Learn 1.0.2 Imbalanced-Learn 0.8.1

bugg

glemaitre commented 1 year ago

It looks like you have an old version of scikit-learn (1.0.2 instead of the latest 1.2.2) and imbalanced-learn (0.8.1 instead of 0.10.1). This has been solved in the latest version.