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.
Installation
Dependencies
imbalanced-learn is tested to work under Python 2.7 and Python 3.5.
scipy(>=0.17.0)
numpy(>=1.10.4)
scikit-learn(>=0.17.1)
Installation
imbalanced-learn is currently available on the PyPi’s reporitories and you can install it via pip:
pip install -U imbalanced-learn
The package is release also in Anaconda Cloud platform:
conda install -c glemaitre imbalanced-learn
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 python setup.py install
Testing
After installation, you can use nose to run the test suite:
make coverage
About
Most classification algorithms will only perform optimally when the number of samples of each class is roughly the same. Highly skewed datasets, where the minority is heavily outnumbered by one or more classes, have proven to be a challenge while at the same time becoming more and more common.
One way of addresing this issue is by re-sampling the dataset as to offset this imbalance with the hope of arriving at a more robust and fair decision boundary than you would otherwise.
- Re-sampling techniques are divided in two categories:
Under-sampling the majority class(es).
Over-sampling the minority class.
Combining over- and under-sampling.
Create ensemble balanced sets.
Below is a list of the methods currently implemented in this module.
- Under-sampling
Random majority under-sampling with replacement
Extraction of majority-minority Tomek links [1]
Under-sampling with Cluster Centroids
NearMiss-(1 & 2 & 3) [2]
Condensend Nearest Neighbour [3]
One-Sided Selection [4]
Neighboorhood Cleaning Rule [5]
Edited Nearest Neighbours [6]
Instance Hardness Threshold [7]
Repeated Edited Nearest Neighbours [14]
The different algorithms are presented in the following notebook.
This is a work in progress. Any comments, suggestions or corrections are welcome.
References:
Metadata
Release files for imbalanced-learn 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imbalanced-learn-0.1.2.tar.gz | 4.9 MB | Without provenance | Details for imbalanced-learn-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imbalanced_learn-0.1.2-py2-none-any.whl | Python 2 | none | any | Details for imbalanced_learn-0.1.2-py2-none-any.whl |
Total release size: 5.0 MB
Release files / imbalanced-learn-0.1.2.tar.gz
| Download URL | imbalanced-learn-0.1.2.tar.gz |
|---|---|
| Size | 4.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16c35f434408a0b78b12a3c54a7e22030bd9becb349954b06d41dd5fe380bfd2
|
|
BLAKE2b-256 checksum How to use checksums |
da48be53f1ac35cdc54a909fea47e73a62b26462c0f0236b7f0736709d266eeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / imbalanced_learn-0.1.2-py2-none-any.whl
| Download URL | imbalanced_learn-0.1.2-py2-none-any.whl |
|---|---|
| Size | 86.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
ff32df8a15b2b37c81f33b0c5e111485daf2099e9a010156e184b84164b6cc8e
|
|
BLAKE2b-256 checksum How to use checksums |
d5f0358ebd5de0d1eaae73c7e278c75ce54130665db359820e8b5839bbe07c11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for imbalanced-learn 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.