Python package for tackling multiclass imbalance problems.
Project description
multi-imbalance
multi-imbalance is a python package tackling the problem of multi-class imbalanced datasets in machine learning.
Requirements
Tha package has been tested under python 3.7. Relies heavily on scikit-learn and typical scientific stack (numpy, scipy, pandas etc.).
Installation
Just type in
pip install multi-imbalance
Implemented algorithms
-
SOUP, MDO
-
ECOC
-
Roughly Balanced Bagging
-
SPIDER3 algorithm implementation for selective preprocessing of multi-class imbalanced data sets, according to article:
Wojciechowski, S., Wilk, S., Stefanowski, J.: An Algorithm for Selective Preprocessing of Multi-class Imbalanced Data. Proceedings of the 10th International Conference on Computer Recognition Systems CORES 2017
Example usage
from multi_imbalance.resampling.mdo import MDO
# Mahalanbois Distance Oversampling
mdo = MDO(k=9, k1_frac=0, seed=0)
# read the data
X_train, y_train, X_test, y_test = ...
# preprocess
X_train_resampled, y_train_resampled = mdo.fit_transform(np.copy(X_train), np.copy(y_train))
# train the classifier on preprocessed data
clf_tree = DecisionTreeClassifier(random_state=0)
clf_tree.fit(X_train_resampled, y_train_resampled)
# make predictions
y_pred = clf_tree.predict(X_test)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file multi-imbalance-0.0.4.tar.gz
.
File metadata
- Download URL: multi-imbalance-0.0.4.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c65af9fbf4b6dfdefcbf54870a247de4f8fbaf6b988d73cb5317a7850bdb5608 |
|
MD5 | 93c57508fbd558a24d0d27c2cbd16f55 |
|
BLAKE2b-256 | c3eeabcc8449709f411ca4349276b0d777c3911efddc72848d4d9b6d14d95ca8 |