Skip to main content

A Python implementation of Synthetic Minority Over-Sampling Technique for Regression with Gaussian Noise (SMOGN)

Project description

Synthetic Minority Over-Sampling Technique for Regression with Gaussian Noise

PyPI version License: GPL v3 Build Status GitHub last commit

Description

A Python implementation of Synthetic Minority Over-Sampling Technique for Regression with Gaussian Noise (SMOGN). Conducts the Synthetic Minority Over-Sampling Technique for Regression (SMOTER) with traditional interpolation, as well as with the introduction of Gaussian Noise (SMOTER-GN). Selects between the two over-sampling techniques by the KNN distances underlying a given observation. If the distance is close enough, SMOTER is applied. If too far away, SMOTER-GN is applied. Useful for prediction problems where regression is applicable, but the values in the interest of predicting are rare or uncommon. This can also serve as a useful alternative to log transforming a skewed response variable, especially if generating synthetic data is also of interest.

Features

  1. The only open-source Python supported version of Synthetic Minority Over-Sampling Technique for Regression

  2. Supports Pandas DataFrame inputs containing mixed data types, auto distance metric selection by data type, and optional auto removal of missing values

  3. Flexible inputs available to control the areas of interest within a continuous response variable and friendly parameters for over-sampling synthetic data

  4. Purely Pythonic, developed for consistency, maintainability, and future improvement, no foreign function calls to C or Fortran, as contained in original R implementation

Installation

## install pypi release
pip install smogn

## install developer version
pip install git+https://github.com/nickkunz/smogn.git

Usage

## load libraries
import smogn
import pandas

## load data
housing = pandas.read_csv(

    ## http://jse.amstat.org/v19n3/decock.pdf
    "https://raw.githubusercontent.com/nickkunz/smogn/master/data/housing.csv"
)

## conduct smogn
housing_smogn = smogn.smoter(

    data = housing, 
    y = "SalePrice"
)

Detailed Examples

  1. Beginner
  2. Intermediate
  3. Advanced

License

© Nick Kunz, 2019. Licensed under the General Public License v3.0 (GPLv3).

Contributions

SMOGN is open for improvements and maintenance. Your help is valued to make the package better for everyone.

Reference

Branco, P., Torgo, L., Ribeiro, R. (2017). SMOGN: A Pre-Processing Approach for Imbalanced Regression. Proceedings of Machine Learning Research, 74:36-50. http://proceedings.mlr.press/v74/branco17a/branco17a.pdf.

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

smogn-0.0.9.tar.gz (186.4 kB view details)

Uploaded Source

Built Distribution

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

smogn-0.0.9-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file smogn-0.0.9.tar.gz.

File metadata

  • Download URL: smogn-0.0.9.tar.gz
  • Upload date:
  • Size: 186.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.4

File hashes

Hashes for smogn-0.0.9.tar.gz
Algorithm Hash digest
SHA256 4abee18257c84f907ed679d1e4cc75a568757cd4a6976786b0dc44ff05a2774f
MD5 479f50496b17d5e70b8bd2b4896f9615
BLAKE2b-256 4d572717a8e7e0b57139874e3ada21cf378a1615d11ee2bfb5e8b6663a04cb22

See more details on using hashes here.

File details

Details for the file smogn-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: smogn-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.4

File hashes

Hashes for smogn-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f87845a9801227deab571edbc64be594eb925debd8db1460c80ee5e43eb0ea45
MD5 fe972775f1f03eecbf776b6ee711df0c
BLAKE2b-256 30d01256fd522cb572990269944a132ebd4be216035b5c0de53e9b28d73e4734

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