--- id: imbalanced-learn version: "0.14.2" license: unclear license_treatment: permissive maintenance: active --- # imbalanced-learn — Toolbox for imbalanced dataset in machine learning License: permissive · Maintenance: active · Downloads: 16.8M/mo ## 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 above — 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 pip install imbalanced-learn uv add imbalanced-learn 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_current - Install friction: low - Maintenance: active - Downloads: 16.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags class imbalance resampling, imbalanced dataset handling, oversampling undersampling, scikit-learn imbalance, minority class balancing, skewed dataset preprocessing, resampling techniques, class-imbalance, resampling, data-preprocessing [View on SkillFed](https://skillfed.io/packages/imbalanced-learn) · [View on PyPI](https://pypi.org/project/imbalanced-learn/)