Python implementation of SMOTE: Synthetic Minority Over-sampling Technique
Tested on Python 2.7 and 3.6, with:
- scipy>=0.19.0
- numpy>=1.13.0
- scikit-learn>=0.18.1
Older versions may work but not tested.
git clone https://github.com/akazs/pySMOTE.git
cd pySMOTE
pip install .
import pySMOTE
smote = pySMOTE.SMOTE(ratio=100, k_neighbors=6)
synthetic_samples = smote.oversample(sample_data)
new_samples = smote.oversample(sample_data, merge=True)