Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1330

Synthetic Minority Oversampling Technique (SMOTE) is an approach used for dealing with imbalanced datasets before running them through machine learning models.

2 votes

Which data hyperparameter tuning using for fit the model

The code would something like this: from imblearn.over_sampling import SMOTE from imblearn.pipeline import Pipeline from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import … train_test_split, RandomizedSearchCV, StratifiedKFold X_train, y_train, X_test, y_test = train_test_split(X, y) pipeline = Pipeline([("smote", SMOTE()), ("rf", RandomForestClassifier())]) kf = StratifiedKFold …
Brian Spiering's user avatar
1 vote

SMOTE and oversampling with constraints

One option would be to do something more similar to bootstrapping since that would be re-sampling existing data. Another option would be to generate extra samples then prune based on the constraints.
Brian Spiering's user avatar
1 vote

How to use SMOTE in Stacking in SKLearn?

First question, whether to use SMOTE for the first or second of a stacked classifiers. … Generally, SMOTE should be done before any classification since SMOTE gives the minority class an increased likelihood be being successfully learned. …
Brian Spiering's user avatar
1 vote

suggestion to implement undersample and oversample

SMOTE - Synthetic Minority Over-sampling Technique is useful for oversampling. You might want to think about dropping Class #6. 14 is not a large enough sample for machine learning. …
Brian Spiering's user avatar
1 vote

Unbalanced data set - how to optimize hyperparams via grid search?

Imbalanced-learn's SMOTE can also be used. If there are fewer samples than k, it will only use available samples. …
Brian Spiering's user avatar
1 vote

Why does class_weight usually outperform SMOTE?

SMOTE stands for Synthetic Minority Over-sampling Technique. The synthetic part means SMOTE fabricates novel samples based on existing data. … SMOTE does this by interpolating new instances based on existing feature values. …
Brian Spiering's user avatar
1 vote

What's the order in applying SMOTE transformation in a pipeline?

Resampling should happen after preprocessing but before the classifier. It is best to use imblearn's Pipeline, instead of scikit-learn's Pipeline. Imblearn's Pipeline is designed to work with resampli …
Brian Spiering's user avatar
0 votes

Train score is very lower than Test score, is that normal?

You are probably not applying the same resampling technique to test dataset. If you put the logic into a imbalanced-learn's Pipeline, the appropriate resampling will be automatically handled for you.
Brian Spiering's user avatar
0 votes

Reproducible examples where balancing the training data demonstrably improves accuracy

lr = LogisticRegression(solver='liblinear', class_weight=None) lr.fit(X_train, y_train) y_pred = lr.predict(X_test) print(balanced_accuracy_score(y_test, y_pred)) The balanced accuracy for non-SMOTE … (X_test) print(balanced_accuracy_score(y_test, y_pred)) The balanced accuracy for SMOTE is ~0.935. …
Brian Spiering's user avatar