Giter Site home page Giter Site logo

kilickursat / cluster-over-sampling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nova-ims-innovation-and-analytics-lab/cluster-over-sampling

0.0 1.0 0.0 77 KB

Clustering based over-sampling.

License: MIT License

Makefile 0.68% Python 99.00% Batchfile 0.08% Shell 0.24%

cluster-over-sampling's Introduction

Travis Codecov CircleCI ReadTheDocs PythonVersion Pypi Conda DOI Black

cluster-over-sampling

Implementation of a general interface for clustering based over-sampling algorithms as described in [1], [2]. It is compatible with scikit-learn and imbalanced-learn.

Instructions

Installation documentation, API documentation, and examples can be found on the documentation.

Dependencies

cluster-over-sampling is tested to work under Python 3.6+. The dependencies are the following:

  • numpy(>=1.1)
  • scikit-learn(>=0.21)
  • imbalanced-learn(>=0.6.2)

Optional dependencies for SOMO and Geometric SOMO are the following:

  • som-learn(>=0.1.1)
  • geometric-smote(>=0.1.3)

Additionally, to run the examples, you need matplotlib(>=2.0.0) and pandas(>=0.22).

Installation

cluster-over-sampling is currently available on the PyPi's repository and you can install it via pip:

pip install -U cluster-over-sampling

The package is released also in Anaconda Cloud platform:

conda install -c algowit cluster-over-sampling

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/AlgoWit/cluster-over-sampling.git
cd cluster-over-sampling
pip install .

Or install using pip and GitHub:

pip install -U git+https://github.com/AlgoWit/cluster-over-sampling.git

Testing

After installation, you can use pytest to run the test suite:

make test

About

If you use cluster-over-sampling in a scientific publication, we would appreciate citations to any of the following papers:

@article{Douzas2017,
  doi = {10.1016/j.eswa.2017.03.073},
  url = {https://doi.org/10.1016/j.eswa.2017.03.073},
  year = {2017},
  month = oct,
  publisher = {Elsevier {BV}},
  volume = {82},
  pages = {40--52},
  author = {Georgios Douzas and Fernando Bacao},
  title = {Self-Organizing Map Oversampling ({SOMO}) for imbalanced data set learning},
  journal = {Expert Systems with Applications}
}

@article{Douzas2018,
  doi = {10.1016/j.ins.2018.06.056},
  url = {https://doi.org/10.1016/j.ins.2018.06.056},
  year = {2018},
  month = oct,
  publisher = {Elsevier {BV}},
  volume = {465},
  pages = {1--20},
  author = {Georgios Douzas and Fernando Bacao and Felix Last},
  title = {Improving imbalanced learning through a heuristic oversampling method based on k-means and {SMOTE}},
  journal = {Information Sciences}
}

Learning from class-imbalanced data continues to be a common and challenging problem in supervised learning as standard classification algorithms are designed to handle balanced class distributions. While different strategies exist to tackle this problem, methods which generate artificial data to achieve a balanced class distribution are more versatile than modifications to the classification algorithm. SMOTE algorithm [3], as well as any other over-sampling method based on the SMOTE mechanism, generates synthetic samples along line segments that join minority class instances. SMOTE addresses only the issue of between-classes imbalance. On the other hand, by clustering the input space and applying any over-sampling algorithm for each resulting cluster with appropriate resampling ratio, the within-classes imbalanced issue can be addressed. SOMO [1] and KMeans-SMOTE [2] are specific realizations of this approach.

References:

[1](1, 2) G. Douzas, F. Bacao, "Self-Organizing Map Oversampling (SOMO) for imbalanced data set learning", Expert Systems with Applications, vol. 82, pp. 40-52, 2017.
[2](1, 2) G. Douzas, F. Bacao, F. Last, "Improving imbalanced learning through a heuristic oversampling method based on k-means and SMOTE", Information Sciences, vol. 465, pp. 1-20, 2018.
[3]N. V. Chawla, K. W. Bowyer, L. O. Hall, W. P. Kegelmeyer, "SMOTE: synthetic minority over-sampling technique", Journal of Artificial Intelligence Research, vol. 16, pp. 321-357, 2002.

cluster-over-sampling's People

Contributors

georgedouzas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.