skillfed

imbalanced-learn

Toolbox for imbalanced dataset in machine learning

imbalanced-learn v0.14.2 16.8M downloads/30d#1,138 on PyPI7,117
Permissive license Active released

What it is and what it does

imbalanced-learn is a scikit-learn-compatible Python toolbox for handling datasets where one class significantly outnumbers others—a common problem in real-world machine learning. It implements multiple re-sampling strategies (both oversampling and undersampling) to balance class distributions before training, helping classification algorithms learn more robust decision boundaries on skewed data.

The package integrates seamlessly into scikit-learn workflows via a standard transformer interface, making it straightforward to include resampling in preprocessing pipelines. It depends on numpy, scipy, scikit-learn, joblib, and threadpoolctl, and supports Python 3.10 through 3.14. The project is actively maintained as part of the scikit-learn-contrib ecosystem.

Use it for:

  • Preprocess fraud detection datasets where fraudulent transactions are rare before training a classifier
  • Balance medical diagnosis datasets with few positive cases to improve model sensitivity
  • Prepare imbalanced text classification data for training with rare event prediction
  • Create balanced training sets in credit risk or loan default prediction tasks
  • Handle class imbalance in anomaly detection or rare failure prediction scenarios

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides re-sampling techniques to address class imbalance in machine learning datasets, integrating with scikit-learn for preprocessing imbalanced data before model training.

Yes. Active maintenance, low install friction, permissive MIT license, and no known vulnerabilities make this a safe choice. It solves a real, common problem in machine learning with a mature, well-integrated API. Install if you work with imbalanced classification datasets.

Install

imbalanced-learn on PyPI

pip

pip install imbalanced-learn

uv

uv add imbalanced-learn

poetry

poetry add imbalanced-learn

Installing imbalanced-learn

Before you install

Low friction installation with a pure-Python wheel. Active maintenance with recent releases; last commit 2026-06-29. Depends on well-established scientific Python stack (numpy, scipy, scikit-learn, joblib).

License in practice

MIT license (permissive) allows use in commercial and private projects with minimal restrictions.

Quickstart

pip install imbalanced-learn

import imbalanced_learn
from sklearn.datasets import make_classification

X, y = make_classification()
# Use imbalanced-learn resampling techniques in preprocessing pipeline

Verify before relying

  • Whether optional dependencies (Pandas, TensorFlow, Keras) are required for core functionality or only for specific features
  • Performance characteristics when handling very large datasets
  • Specific resampling algorithms included and their names

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — numpy, scipy, scikit-learn, sklearn-compat, joblib, threadpoolctl
Maintenance actively maintained — 68 days since the last release
Last repo commit
First released
Downloads 16,822,922/month — #1,138 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: imbalanced_learn-0.14.2-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Software Development :: Libraries

Tags

class imbalance resamplingimbalanced dataset handlingoversampling undersamplingscikit-learn imbalanceminority class balancingskewed dataset preprocessingresampling techniques
class-imbalanceresamplingdata-preprocessing

More Libraries packages