Skip to main content

Implementation of Dynamic Ensemble Selection methods

Project description

Documentation Status https://travis-ci.org/Menelau/DESlib.svg?branch=master https://codecov.io/gh/Menelau/DESlib/branch/master/graph/badge.svg Code Health https://img.shields.io/badge/License-BSD%203--Clause-blue.svg

DESlib

DESlib is an easy to use ensemble learning library focusing the implementation of the state-of-the-art techniques for dynamic classifier and ensemble selection. The library is is based on scikit-learn, using the same method signature: fit, predict, predict_proba and score. All dynamic selection techniques were implemented according to the definitions from [1].

Dynamic Selection:

Dynamic Selection (DS) refers to techniques in which the base classifiers are selected on the fly, according to each new sample to be classified. Only the most competent, or an ensemble containing the most competent classifiers is selected to predict the label of a specific test sample. The rationale for such techniques is that not every classifier in the pool is an expert in classifying all unknown samples; rather, each base classifier is an expert in a different local region of the feature space.

DS is one of the most promising MCS approaches due to the fact that more and more works are reporting the superior performance of such techniques over static combination methods. Such techniques have achieved better classification performance especially when dealing with small-sized and imbalanced datasets.

Installation:

The package can be installed using pip:

Stable version:

pip install deslib

Latest version (under development):

pip install git+https://github.com/Menelau/DESlib

Dependencies:

DESlib is tested to work with Python 3.5, and 3.6. The dependency requirements are:

  • scipy(>=0.13.3)

  • numpy(>=1.10.4)

  • scikit-learn(>=0.19.0)

These dependencies are automaticatically installed using the pip commands above.

Description:

The library is divided into four modules:

  1. deslib.des: Implementation of DES techniques.

  2. deslib.dcs: Implementation of DCS techniques.

  3. deslib.static: Implementation of baseline ensemble methods.

  4. deslib.util: A collection of aggregation functions and diversity measures for ensemble of classifiers.

  • DES techniques currently available are:
    1. META-DES [7] [8] [15]

    2. K-Nearest-Oracle-Eliminate (KNORA-E) [3]

    3. K-Nearest-Oracle-Union (KNORA-U) [3]

    4. Dynamic Ensemble Selection-Performance(DES-P) [12]

    5. K-Nearest-Output Profiles (KNOP) [9]

    6. Randomized Reference Classifier (DES-RRC) [10]

    7. DES Kullback-Leibler Divergence (DES-KL) [12]

    8. DES-Exponential [21]

    9. DES-Logarithmic [11]

    10. DES-Minimum Difference [21]

    11. DES-Clustering [16]

    12. DES-KNN [16]

  • DCS techniques currently available are:
    1. Modified Classifier Rank (Rank) [19]

    2. Overall Locall Accuracy (OLA) [4]

    3. Local Class Accuracy (LCA) [4]

    4. Modified Local Accuracy (MLA) [23]

    5. Multiple Classifier Behaviour (MCB) [5]

    6. A Priori Selection (A Priori) [6]

    7. A Posteriori Selection (A Posteriori) [6]

  • Baseline methods:
    1. Oracle [20]

    2. Single Best [2]

    3. Static Selection [2]

Variations of each DES techniques are also provided by the library (e.g., different versions of the META-DES framework). Moreover, each DES technique can be used as Dynamic Selection, Dynamic Weighting or a Hybrid version which includes dynamic selection + weighting. The library also offers the implementation of methods which can be applied to DS techniques in order to improve the classification accuracy such as the Dynamic Frienemy Pruning (DFP) [13].

Examples:

Here we show an example using the KNORA-E method using random forest as a pool of classifiers:

from sklearn.ensemble import RandomForestClassifier
from deslib.des.knora_e import KNORAE


# Train a pool of 10 classifiers
pool_classifiers = RandomForestClassifier(n_estimators=10)
pool_classifiers.fit(X_train, y_train)

# Initialize the DES model
knorae = KNORAE(pool_classifiers)

# Preprocess the Dynamic Selection dataset (DSEL)
knorae.fit(X_dsel, y_dsel)

# Predict new examples:
knorae.predict(X_test)

The library accepts any list of classifiers (from scikit-learn) as input, including a list containing different classifier models (heterogeneous ensembles). More examples to use the API can be found in the documentation and im the Examples directory.

References:

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

DESlib-0.1.2.tar.gz (94.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DESlib-0.1.2-py3-none-any.whl (103.6 kB view details)

Uploaded Python 3

File details

Details for the file DESlib-0.1.2.tar.gz.

File metadata

  • Download URL: DESlib-0.1.2.tar.gz
  • Upload date:
  • Size: 94.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for DESlib-0.1.2.tar.gz
Algorithm Hash digest
SHA256 69c4c73fa8395aebbc760c27717226f8cd12341c1aac7c1a71fc0d4c7e691cd7
MD5 c2f097b720a06d5eef3ba56c42dc216b
BLAKE2b-256 320018f9184117912f2df57ebab8c9f4613e362ff0edabf5e3b11f9dd9f25ec6

See more details on using hashes here.

File details

Details for the file DESlib-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for DESlib-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c1c6763937cfe55775828cc8022642f774f450e3e4d215b6847e34b58b7963e
MD5 728d9923683949e08cbdb1fc5be34e00
BLAKE2b-256 f7b6309d2716b33ee687d49fa6c17c6396ba2d467ac265c8bbe3ed9af2405452

See more details on using hashes here.

Supported by

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