Contents
How does SMOTE work for categorical data?
SMOTE-NC is capable of handling a mix of categorical and continuous features. So as per documentation SMOTE doesn’t support Categorical data in Python yet, and provides continuous outputs. You can instead employ a workaround where you convert the categorical variables to integers and use SMOTE.
Which is better oversampling or undersampling?
Oversampling methods duplicate or create new synthetic examples in the minority class, whereas undersampling methods delete or merge examples in the majority class. Both types of resampling can be effective when used in isolation, although can be more effective when both types of methods are used together.
How does smote-NC change the way sample is generated?
SMOTE-NC slightly changes the way a new sample is generated by performing something specific for the categorical features. In fact, the categories of a new generated sample are decided by picking the most frequent category of the nearest neighbors present during the generation.
How is smote-NC used in machine learning?
The goal was to build a predictive machine learning model that could categorize users as either, revenue generating and non-revenue generation based on their behavior while navigating a website. This blogpost will focus on SMOTE-NC, and its effect on the machine learning models’ scores used to categorize the data.
Which is the best training set for smote-NC?
I trained four plain-vanilla machine learning algorithms before applying SMOTE-NC to the training set. The machine learning algorithms are: Decision tree, logistic regression, random forest and gradient boosting. Given the imbalanced nature of the data the best classification scores are the f1 and the area under the curve scores.
How does smote-NC keep target incidence the same?
It is important to note that during the split, using the train test split tool in the sklearn library, the split was done setting the hyperparameter ‘stratify=target’ to keep the same target incidence on both, the training and testing dataset.