Skip to main content

Python package for tackling multiclass imbalance problems.

Project description

Build Status

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

  1. SOUP, MDO

  2. ECOC

  3. Roughly Balanced Bagging

  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multi-imbalance-0.0.4.tar.gz (23.5 kB view details)

Uploaded Source

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

Hashes for multi-imbalance-0.0.4.tar.gz
Algorithm Hash digest
SHA256 c65af9fbf4b6dfdefcbf54870a247de4f8fbaf6b988d73cb5317a7850bdb5608
MD5 93c57508fbd558a24d0d27c2cbd16f55
BLAKE2b-256 c3eeabcc8449709f411ca4349276b0d777c3911efddc72848d4d9b6d14d95ca8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page