Skip to main content

Synthetic Minority Over-Sampling Technique for Regression with Gaussian Noise

PyPI version License: GPL v3 Build Status Codacy Badge 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.

Requirements

  1. Python 3
  2. NumPy
  3. Pandas

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"
)

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.

Release files for smogn 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smogn 0.1.2
File Size Uploaded
smogn-0.1.2.tar.gz 185.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smogn 0.1.2
File Interpreter ABI Platform
smogn-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 216.1 kB

Release files / smogn-0.1.2.tar.gz

Download URL smogn-0.1.2.tar.gz
Size 185.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6555b907f2c9df223eae8813abd09054ad6491fc8509a23fccc9d578b3e76d89
BLAKE2b-256 checksum
How to use checksums
b7fbdb39a4c4df49bc1754439027978e064191447b8979e69692833a6a4ccdb1
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / smogn-0.1.2-py3-none-any.whl

Download URL smogn-0.1.2-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3df02540674d2164713e661446ff73994f98bb3029d5ea7ad0107ffedb700fec
BLAKE2b-256 checksum
How to use checksums
fea6a3f78f5e2e18fa302fd23a32019908657113faa917463a9d49cbe9d20625
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.6

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page