Giter Site home page Giter Site logo

cost_sensitive_vs_resampling's Introduction

Comparison of cost sensitive learning algorithms and sampling methods on imbalanced datasets

There are many applications which require dealing with imbalanced datasets, such as fraud detection, fault prediction in industrial machinery and rare diseases diagnostic. Machine learning algorithms can tend to favor the majority class error minimization, which is frequently of less interest in practice. Approaches to overcome this difficulty include data resampling and the use of cost sensitive algorithms. These algorithms tend to be less studied due to the requirement to define a cost matrix, which can be determined by a specialist or via techniques to estimate its values. Nonetheless, cost sensitive algorithms can have less impact on the dataset than resampling methods. This work aims to compare the performance of these approaches on datasets with varying levels of imbalance.

This repository is structured as follows:

  • synthetic_datasets:
    • scripts: contains the scripts to create the synthetic datasets
    • output: contains the synthetic datasets
  • experiments:
    • run_pmlb.py: script to run experiments on Penn Machine Learning Benchmark
    • run_synthetic_datasets.py: script to run experiments on synthetic datasets
    • config.py: experiments hyperparameters
    • experiment.py: data processing pipeline
    • BayesMinimumRiskClassifierSklearnCompat.py: Wrapper to make costcla's BayesMinimumRisk classifier compatible with Scikit-learn cross-validation
    • ThresholdingSklearnCompat.py: Wrapper to make costcla's Thresholding classifier compatible with Scikit-learn cross-validation
    • CostSensitiveDecisionTreeSklearnCompat.py: Wrapper to make costcla's Cost Sensitive Decisiion Tree classifier compatible with Scikit-learn cross-validation
    • cost_matrix_util.py Cost matrix auxiliary functions

Synthetic datasets

Each dataset contains N=10,000 examples with two predictors (v=2) and one binary target variable. The majority variable was obtained from an uniform distribution e covers the whole available space.

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.