A Python library for handling imbalanced datasets in machine learning, currently at version 0.14.1, with a release cadence of approximately every 6 months.
pip install imbalanced-learnVerified import paths — ran on the pinned version, not inferred.
A quickstart example demonstrating the use of RandomOverSampler to balance an imbalanced dataset.
Upgrade to imbalanced-learn 0.14.1 or later.
Restart the Python kernel after installation to resolve import errors. ([stackoverflow.com](https://stackoverflow.com/questions/60254805/imbalanced-learn-import-error-cannot-import-name-multioutputmixin?utm_source=openai))
Upgrade to imbalanced-learn 0.14.1 or later. ([github.com](https://github.com/scikit-learn-contrib/imbalanced-learn/issues/1119?utm_source=openai))
Ensure a C/C++ compiler toolchain is installed in the environment before attempting installation. For Alpine Linux, this typically involves `apk add build-base`.
Install the package using pip: `pip install imbalanced-learn` or with conda: `conda install -c conda-forge imbalanced-learn`.
Replace `fit_sample()` with `fit_resample()` for all resampling objects, e.g., `X_resampled, y_resampled = SMOTE().fit_resample(X, y)`.
Explicitly import the desired submodule or class, for example, `from imblearn import ensemble` or `from imblearn.ensemble import EasyEnsembleClassifier`.