I am using SMOTE in Python to perform oversampling of the minor class in an unbalanced dataset. I would like to know the way SMOTE formats its output, that is, whether SMOTE concatenates the newly generated samples to the end of the input data and returns that as the output or whether the new synthetic data points are positioned randomly among the input data points. I'd appreciate your help.
2 Answers
There is not that much package managing the under-/over-sampling in python. So if you are using imbalanced-learn, it will return a numpy array which concatenate the original imbalanced set with the generated new samples in the minority class.
-
$\begingroup$ I am indeed using the imbalanced-learn package, and that's what i got from the code. i just wanted to make sure that i correctly understood it. thanks for your help :) $\endgroup$– darXiderJul 14, 2016 at 13:09
SMOTE is an algorithm used to generate " synthesize" new samples from the real samples. It selects randomly one of the k-nearest neighbors, find the distance between these two pints , synthesize new point by modifying the sample considering the distance and a random number between 0 and 1. SMOTE algorithm does not use samples from majority class only samples from minority. It synthesizes new samples It expects a high density minor class with small variation within the class Anything else is related to the implementation, many implementation return only the synthesized samples
-
$\begingroup$ thanks! i am aware of the way SMOTE works, and my question was only with regard to the inner working of its Python implementation in the package imbalanced-learn. thanks for the description though. $\endgroup$– darXiderJul 14, 2016 at 13:28