This README file is a copy from Nick Kunz's package SMOGN and should be modified by the end of Winter 2022 semester!
A Python implementation of sampling techniques for Regression. Conducts different sampling techniques for Regression. 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.
-
An open-source Python supported version of sampling techniques for Regression, a variation of Nick Kunz's package SMOGN.
-
Supports Pandas DataFrame inputs containing mixed data types, auto distance metric selection by data type, and optional auto removal of missing values.
-
Flexible inputs available to control the areas of interest within a continuous response variable and friendly parameters for over-sampling synthetic data.
-
Purely Pythonic, developed for consistency, maintainability, and future improvement, no foreign function calls to C or Fortran, as contained in original R implementation.
- Python 3
- NumPy
- Pandas
## install pypi release
pip install ImbalancedLearnRegression
## install developer version
pip install git+https://github.com/paobranco/ImbalancedLearnRegression.git
## load libraries
import ImbalancedLearnRegression
import pandas
## load data
housing = pandas.read_csv(
## http://jse.amstat.org/v19n3/decock.pdf
"https://raw.githubusercontent.com/paobranco/ImbalancedLearnRegression/master/data/housing.csv"
)
## conduct ro
housing_ro = ro(
data = housing,
y = "SalePrice"
)
## conduct gn
housing_gn = gn(
data = housing,
y = "SalePrice"
)
© Paula Branco, 2022. Licensed under the General Public License v3.0 (GPLv3).
ImbalancedLearnRegression is open for improvements and maintenance. Your help is valued to make the package better for everyone.
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.
Branco, P., Torgo, L., & Ribeiro, R. P. (2019). Pre-processing approaches for imbalanced distributions in regression. Neurocomputing, 343, 76-99. https://www.sciencedirect.com/science/article/abs/pii/S0925231219301638
Kunz, N., (2019). SMOGN. https://github.com/nickkunz/smogn
Torgo, L., Ribeiro, R. P., Pfahringer, B., & Branco, P. (2013, September). Smote for regression. In Portuguese conference on artificial intelligence (pp. 378-389). Springer, Berlin, Heidelberg. https://link.springer.com/chapter/10.1007/978-3-642-40669-0_33