freshcrate
Skin:/
Home > Frameworks > imbalanced-learn

imbalanced-learn

Toolbox for imbalanced dataset in machine learning

Why this rank:Strong adoptionRelease freshnessHealthy release cadence

Description

.. -*- mode: rst -*- .. _scikit-learn: http://scikit-learn.org/stable/ .. _scikit-learn-contrib: https://github.com/scikit-learn-contrib |GitHubActions|_ |Codecov|_ |CircleCI|_ |PythonVersion|_ |Pypi|_ |Gitter|_ |Black|_ .. |GitHubActions| image:: https://github.com/scikit-learn-contrib/imbalanced-learn/actions/workflows/tests.yml/badge.svg .. _GitHubActions: https://github.com/scikit-learn-contrib/imbalanced-learn/actions/workflows/tests.yml .. |Codecov| image:: https://codecov.io/gh/scikit-learn-contrib/imbalanced-learn/branch/master/graph/badge.svg .. _Codecov: https://codecov.io/gh/scikit-learn-contrib/imbalanced-learn .. |CircleCI| image:: https://circleci.com/gh/scikit-learn-contrib/imbalanced-learn.svg?style=shield .. _CircleCI: https://circleci.com/gh/scikit-learn-contrib/imbalanced-learn/tree/master .. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/imbalanced-learn.svg .. _PythonVersion: https://img.shields.io/pypi/pyversions/imbalanced-learn.svg .. |Pypi| image:: https://badge.fury.io/py/imbalanced-learn.svg .. _Pypi: https://badge.fury.io/py/imbalanced-learn .. |Gitter| image:: https://badges.gitter.im/scikit-learn-contrib/imbalanced-learn.svg .. _Gitter: https://gitter.im/scikit-learn-contrib/imbalanced-learn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge .. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg .. _Black: :target: https://github.com/psf/black .. |PythonMinVersion| replace:: 3.10 .. |NumPyMinVersion| replace:: 1.25.2 .. |SciPyMinVersion| replace:: 1.11.4 .. |ScikitLearnMinVersion| replace:: 1.4.2 .. |MatplotlibMinVersion| replace:: 3.7.3 .. |PandasMinVersion| replace:: 2.0.3 .. |TensorflowMinVersion| replace:: 2.16.1 .. |KerasMinVersion| replace:: 3.3.3 .. |SeabornMinVersion| replace:: 0.12.2 .. |PytestMinVersion| replace:: 7.2.2 imbalanced-learn ================ imbalanced-learn is a python package offering a number of re-sampling techniques commonly used in datasets showing strong between-class imbalance. It is compatible with scikit-learn_ and is part of scikit-learn-contrib_ projects. Documentation ------------- Installation documentation, API documentation, and examples can be found on the documentation_. .. _documentation: https://imbalanced-learn.org/stable/ Installation ------------ Dependencies ~~~~~~~~~~~~ `imbalanced-learn` requires the following dependencies: - Python (>= |PythonMinVersion|) - NumPy (>= |NumPyMinVersion|) - SciPy (>= |SciPyMinVersion|) - Scikit-learn (>= |ScikitLearnMinVersion|) - Pytest (>= |PytestMinVersion|) Additionally, `imbalanced-learn` requires the following optional dependencies: - Pandas (>= |PandasMinVersion|) for dealing with dataframes - Tensorflow (>= |TensorflowMinVersion|) for dealing with TensorFlow models - Keras (>= |KerasMinVersion|) for dealing with Keras models The examples will requires the following additional dependencies: - Matplotlib (>= |MatplotlibMinVersion|) - Seaborn (>= |SeabornMinVersion|) Installation ~~~~~~~~~~~~ From PyPi or conda-forge repositories ..................................... imbalanced-learn is currently available on the PyPi's repositories and you can install it via `pip`:: pip install -U imbalanced-learn The package is release also in Anaconda Cloud platform:: conda install -c conda-forge imbalanced-learn From source available on GitHub ............................... If you prefer, you can clone it and run the setup.py file. Use the following commands to get a copy from Github and install all dependencies:: git clone https://github.com/scikit-learn-contrib/imbalanced-learn.git cd imbalanced-learn pip install . Be aware that you can install in developer mode with:: pip install --no-build-isolation --editable . If you wish to make pull-requests on GitHub, we advise you to install pre-commit:: pip install pre-commit pre-commit install Testing ~~~~~~~ After installation, you can use `pytest` to run the test suite:: make coverage Development ----------- The development of this scikit-learn-contrib is in line with the one of the scikit-learn community. Therefore, you can refer to their `Development Guide <http://scikit-learn.org/stable/developers>`_. Endorsement of the Scientific Python Specification -------------------------------------------------- We endorse good practices from the Scientific Python Ecosystem Coordination (SPEC). The full list of recommendations is available `here`_. See below the list of recommendations that we endorse for the imbalanced-learn project. |SPEC 0 โ€” Minimum Supported Dependencies| .. |SPEC 0 โ€” Minimum Supported Dependencies| image:: https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038 :target: https://scientific-python.org/specs/spec-0000/ .. _here: https://scientific-python.org/specs/ About ----- If you use imbalanced-learn in a scientific publication, we would appreciate citations to the following paper:: @arti

Release History

VersionChangesUrgencyDate
0.14.1Imported from PyPI (0.14.1)Low4/21/2026
0.14.0# Changelog ## Enhancements - Add [InstanceHardnessCV](https://imbalanced-learn.org/stable/references/generated/imblearn.model_selection.InstanceHardnessCV.html#imblearn.model_selection.InstanceHardnessCV) to split data and ensure that samples are distributed in folds based on their instance hardness. [#1125](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1125) by [Frits Hermans](https://github.com/fritshermans). ## Compatibility - Compatibility with scikit-learn 1.7 [Low8/14/2025
0.13.0## Changelog ### Bug fixes - Fix `get_metadata_routing` in `Pipeline` such that one can use a sampler with metadata routing. #1115 by @glemaitre. ### Compatibility - Compatibility with scikit-learn 1.6. #1109 by @glemaitre. ### Deprecations - `Pipeline` now uses `check_is_fitted`. In 0.15, it will raise an error instead of a warning. #1109 by @glemaitre. - `algorithm` parameter in `RUSBoostClassifier` is now deprecated and will be removed in 0.14. #1109 by @glemaitre. Low12/20/2024
0.12.4## Changelog ### Compatibility - Compatibility with NumPy 2.0+ [#1097](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1097) by [Guillaume Lemaitre](https://github.com/glemaitre).Low10/4/2024
0.12.3## Changelog ### Compatibility - Compatibility with scikit-learn 1.5 [#1074](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1074) and [#1084](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1084) by [Guillaume Lemaitre](https://github.com/glemaitre).Low5/28/2024
0.12.2## Changelog ### Bug fixes - Fix the way we check for a specific Python version in the test suite. [#1075](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1075) by [Guillaume Lemaitre](https://github.com/glemaitre).Low3/31/2024
0.12.1## Changelog ### Bug fixes - Fix a bug in [InstanceHardnessThreshold](https://imbalanced-learn.org/stable/references/generated/imblearn.under_sampling.InstanceHardnessThreshold.html#imblearn.under_sampling.InstanceHardnessThreshold) where estimator could not be a Pipeline object. [#1049](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1049) by [Gonenc Mogol](https://github.com/gmogol). ### Compatibility - Do not use distutils in tests due to deprecation. [#1065](https:/Low3/31/2024
0.12.0Changelog ======== Bug fixes --------- - Fix a bug in [SMOTENC](https://imbalanced-learn.org/dev/references/generated/imblearn.over_sampling.SMOTENC.html#imblearn.over_sampling.SMOTENC) where the entries of the one-hot encoding should be divided by sqrt(2) and not 2, taking into account that they are plugged into an Euclidean distance computation. [#1014](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/1014) by [Guillaume Lemaitre](https://github.com/glemaitre). - Raise anLow1/24/2024
0.11.0# Changelog ## Bug fixes - Fix a bug in [classification_report_imbalanced](https://imbalanced-learn.org/stable/references/generated/imblearn.metrics.classification_report_imbalanced.html#imblearn.metrics.classification_report_imbalanced) where the parameter `target_names` was not taken into account when `output_dict=True`. [#989](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/989) by [AYY7](https://github.com/AYY7). - [SMOTENC](https://imbalanced-learn.org/stable/referencLow7/8/2023
0.10.1Changelog ======== Bug fixes --------- - Fix a regression in over-sampler where the string `minority` was rejected as an unvalid sampling strategy. #964 by Prakhyath07.Low7/7/2023
0.10.0Changelog ======== Bug fixes --------- - Make sure that Substitution is working with `python -OO` that replaces __doc__ by None. [#953](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/953) bu [Guillaume Lemaitre](https://github.com/glemaitre). Compatibility ------------- - Maintenance release for being compatible with scikit-learn >= 1.0.2. [#946](https://github.com/scikit-learn-contrib/imbalanced-learn/pull/946), [#947](https://github.com/scikit-learn-contrib/imbalaLow12/9/2022
0.9.1Compatibility with scikit-learn 1.1.0Low5/16/2022
0.9.0Compatibility with scikit-learn 1.0.2Low1/16/2022
0.8.1# Version 0.8.1 September 29, 2021 ### Maintenance Make imbalanced-learn compatible with scikit-learn 1.0. #864 by Guillaume Lemaitre.Low9/29/2021
0.8.0# Version 0.8.0 **February 18, 2021** ## Changelog ### New features - Add the the function `imblearn.metrics.macro_averaged_mean_absolute_error` returning the average across class of the MAE. This metric is used in ordinal classification. #780 by Aurรฉlien Massiot. - Add the class `imblearn.metrics.pairwise.ValueDifferenceMetric` to compute pairwise distances between samples containing only categorical values. #796 by Guillaume Lemaitre. - Add the class `imblearn.over_sampling.SMOTELow2/18/2021
0.7.0A release to bump the minimum version of scikit-learn to 0.23 with a couple of bug fixes. Check the what's new for more information.Low6/9/2020
0.6.2This is a bug-fix release to resolve some issues regarding the handling the input and the output format of the arrays. Changelog ------------- * Allow column vectors to be passed as targets. #673 by @chkoar. * Better input/output handling for pandas, numpy and plain lists. #681 by @chkoar. Low2/16/2020
0.6.1This is a bug-fix release to primarily resolve some packaging issues in version 0.6.0. It also includes minor documentation improvements and some bug fixes. Changelog -------------- Bug fixes ------------ - Fix a bug in :class:`imblearn.ensemble.BalancedRandomForestClassifier` leading to a wrong number of samples used during fitting due max_samples and therefore a bad computation of the OOB score. :pr:`656` by :user:`Guillaume Lemaitre <glemaitre>`. Low12/7/2019
0.6.0Changelog --------- Changed models .............. The following models might give some different sampling due to changes in scikit-learn: - :class:`imblearn.under_sampling.ClusterCentroids` - :class:`imblearn.under_sampling.InstanceHardnessThreshold` The following samplers will give different results due to change linked to the random state internal usage: - :class:`imblearn.over_sampling.SMOTENC` Bug fixes ......... - :class:`imblearn.under_sampling.InstanceHardnessThLow12/5/2019
0.5.0Version 0.5.0 ============= Changed models --- The following models or function might give different results even if the same data ``X`` and ``y`` are the same. * :class:`imblearn.ensemble.RUSBoostClassifier` default estimator changed from :class:`sklearn.tree.DecisionTreeClassifier` with full depth to a decision stump (i.e., tree with ``max_depth=1``). Documentation --- - Correct the definition of the ratio when using a ``float`` in sampling strategy for the over-samLow6/28/2019
0.4.3Mainly bugfix in SMOTE NCLow11/6/2018
0.4.2Version 0.4.2 Bug fixes * Fix a bug in imblearn.over_sampling.SMOTENC in which the the median of the standard deviation instead of half of the median of the standard deviation. By Guillaume Lemaitre in #491. * Raise an error when passing target which is not supported, i.e. regression target or multilabel targets. Imbalanced-learn does not support this case. By Guillaume Lemaitre in #490. Low10/21/2018
0.4.1Version 0.4 =========== October, 2018 Version 0.4 is the last version of imbalanced-learn to support Python 2.7 and Python 3.4. Imbalanced-learn 0.5 will require Python 3.5 or higher. Highlights ---------- This release brings its set of new feature as well as some API changes to strengthen the foundation of imbalanced-learn. As new feature, 2 new modules `imblearn.keras` and `imblearn.tensorflow` have been added in which imbalanced-learn samplers can be used to generate balaLow10/12/2018
0.4.0Version 0.4 =========== **October, 2018** .. warning:: Version 0.4 is the last version of imbalanced-learn to support Python 2.7 and Python 3.4. Imbalanced-learn 0.5 will require Python 3.5 or higher. Highlights ---------- This release brings its set of new feature as well as some API changes to strengthen the foundation of imbalanced-learn. As new feature, 2 new modules `imblearn.keras` and `imblearn.tensorflow` have been added in which imbalanced-learn samplers Low10/12/2018
0.3.4Just for switching documentationLow9/7/2018
0.3.3Bug fix in the classification reportLow2/22/2018
0.3.2Release 0.3.2Low12/7/2017
0.3.1Minor documentation revisionsLow10/9/2017
0.3.0# What's new in version 0.3.0 ## Testing - Pytest is used instead of nosetests. :issue:`321` by `Joan Massich`_. ## Documentation - Added a User Guide and extended some examples. :issue:`295` by `Guillaume Lemaitre`_. # Bug fixes - Fixed a bug in :func:`utils.check_ratio` such that an error is raised when the number of samples required is negative. :issue:`312` by `Guillaume Lemaitre`_. - Fixed a bug in :class:`under_sampling.NearMiss` version 3. The indices returned wLow10/9/2017
0.2.1Release 0.2.1Low1/1/2017
0.2.0Release 0.2.0 Low12/31/2016
0.1.9Release 0.1.9Low12/26/2016
0.1.8Release 0.1.8Low9/7/2016
0.2.0.dev0Release 0.2.0.dev0Low9/1/2016
0.1.7Release 0.1.7Low8/31/2016
0.1.6Bug fix for NearMiss 3 Low8/9/2016
0.1.5Release 0.1.5 Low7/31/2016
0.1.4Release 0.1.4 Bug fix for EasyEnsemble method Low7/31/2016
0.1.3Solve an issue with ADASYN Low7/19/2016
0.1.2Release created after transferring the repository to `scikit-learn-contrib`. Low7/19/2016
0.1.1Release 0.1.1Low7/9/2016

Dependencies & License Audit

Loading dependencies...

Similar Packages

tqdmFast, Extensible Progress Meterv4.68.1
inspect-aiFramework for large language model evaluationsmain@2026-06-05
hypothesisThe property-based testing library for Pythonv6.155.2
bleachAn easy safelist-based HTML-sanitizing tool.main@2026-06-05
jupyter-clientJupyter protocol implementation and client librariesv8.9.0

More from pypi

markitdownUtility tool for converting various files to Markdown
fastapiFastAPI framework, high performance, easy to learn, fast to code, ready for production
djangoA high-level Python web framework that encourages rapid development and clean, pragmatic design.
flaskA simple framework for building complex web applications.

More in Frameworks

langchainThe agent engineering platform
deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of ta
tqdmFast, Extensible Progress Meter
simBuild, deploy, and orchestrate AI agents. Sim is the central intelligence layer for your AI workforce.