Questions tagged [smote]

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

Filter by
Sorted by
Tagged with
20
votes
3answers
19k views

How do you apply SMOTE on text classification?

Synthetic Minority Oversampling Technique (SMOTE) is an oversampling technique used in an imbalanced dataset problem. So far I have an idea how to apply it on generic, structured data. But is it ...
15
votes
3answers
15k views

Train/Test Split after performing SMOTE

I am dealing with a highly unbalanced dataset so I used SMOTE to resample it. After SMOTE resampling, I split the resampled dataset into training/test sets using the training set to build a model and ...
8
votes
1answer
1k views

What is the best performance metric used in balancing dataset using SMOTE technique

I used smote technique to oversample my dataset and now I have a balanced dataset. The problem I faced is that the performance metrics; precision, recall, f1 measure, accuracy in the imbalanced ...
7
votes
1answer
749 views

Why you shouldn't upsample before cross validation

I have an imbalanced dataset and I am trying different methods to address the data imbalance. I found this article that explains the correct way to cross validate when oversampling data using SMOTE ...
6
votes
2answers
4k views

Oversampling/Undersampling only train set only or both train and validation set

I am working on a dataset with class imbalance problem. Now, I know one needs to oversample or undersample only the train set and not the test set. But my issue is: whether to oversample the train set ...
5
votes
2answers
7k views

Why class weight is outperforming oversampling?

I am applying both class_weight and oversampling (SMOTE) techniques on a multiclass classification problem and getting better results when using the class_weight technique. Could someone please ...
5
votes
3answers
27k views

SMOTE and multi class oversampling

I have read that the SMOTE package is implemented for binary classification. In the case of n classes, it creates additional examples for the smallest class. Can I balance all the classes by running ...
5
votes
2answers
2k views

SMOTE for multilabel classification

I have a dataset with 77 different labels. Each sample has one or more of these labels. I did some data analysis and found out that the dataset is highly imbalanced - there are a large number of ...
5
votes
1answer
2k views

How to avoid resampling part of pipeline on test data (imblearn package, SMOTE)

I am using the imblearn package to resample some data before applying other transformation/prediction techniques. Specfically, I am using SMOTE in a slightly unconventional way, as a data ...
4
votes
1answer
258 views

Combining 'class_weight' with SMOTE

This might sound a weird question, but I could not find enough details in sklearn documentation about 'class_weight'. Can we first oversample the dataset using SMOTE and then call the classifier with ...
4
votes
1answer
2k views

Logic behind SMOTE-NC?

In the SMOTE paper here, the authors present the logic for creating synthetic examples when some of the features are nominal and some are continuous (section 6.1, SMOTE-NC). This example is provided: ...
4
votes
1answer
106 views

Why removing rows with NA values from the majority class improves model performance

I have an imbalanced dataset like so: df['y'].value_counts(normalize=True) * 100 ...
3
votes
1answer
743 views

Should I oversample my validation data to get better F1 score and PRC?

I am currently working with a dataset that is imbalanced, about 30k rows * 14 features (just for you know), and 99.5% of the data is labeled 0. Since the model is strongly imbalanced I decided to use ...
3
votes
1answer
2k views

SVM SMOTE fit_resample() function runs forever with no result

Problem fit_resample(X,y) is taking too long to complete execution for 2million rows. Dataset specifications I have a labeled dataset about network features, ...
3
votes
1answer
3k views

PCA, SMOTE and cross validation- how to combine them together?

I was reading a lot recently about PCA and cross validation and it seems that the majority call it malpractice to do PCA before cross validation. I would also like to perform SMOTE, but there is a ...
3
votes
1answer
3k views

SMOTE vs SMOTE-NC for binary classifier with categorical and numeric data

I am using Xgboost for classification. My y is 0 or 1 (true or false). I have categorical and numeric features, so theoretically, I need to use SMOTE-NC instead of ...
3
votes
2answers
2k views

Resampling with Python SMOTE

I am trying to do a simple ML re-sampling approach after the train-test split. However when I do this, it throws the below error. Can you please help me understand what this error is about? ...
3
votes
2answers
92 views

SMOTE on training data

The SMOTE could only be performed on the training data, so how can we do it using Weka? It means we have to put the training and test data in two separate files and run the SMOTE on the training file, ...
3
votes
0answers
358 views

Balancing the dataset using imblearn undersampling, oversampling and combine?

I have the imbalanced dataset: data['Class'].value_counts() Out[22]: 0 137757 1 4905 Name: Class, dtype: int64 ...
3
votes
1answer
103 views

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

I would like to optimize the hyperparameters C and Gamma of an SVC by using grid search for an unbalanced data set. So far I have used class_weights='balanced' and selected the best hyperparameters ...
3
votes
0answers
358 views

How to apply oversampling when doing Leave-One-Group-Out cross validation?

I am working on an imbalanced data for classification and I tried to use SMOTE previously to oversampling the training data. However, this time I think I need to use a leave-on group out (LOGO) cross-...
2
votes
1answer
5k views

SMOTE for regression

I am looking into upsampling an imbalanced dataset for a regression problem (Numerical target variables) in python. I attached paper and R package that implement SMOTE for regression, can anyone ...
2
votes
2answers
122 views

Main options on how to deal with imbalanced data

As far as I can tell, broadly speaking, there are three ways of dealing with binary imbalanced datasets: Option 1: Create k-fold Cross-Validation samples randomly (or even better create k-fold ...
2
votes
1answer
257 views

SMOTE oversampling for class imbalanced dataset introduces bias in final distribution

I have a problem statement where percentage of goods (denoted by 0) is 95%, and for bads (denoted by 1) it is 5% only. One way is to do under sampling of goods so that model understands the patterns ...
2
votes
1answer
578 views

Using SMOTENC in a pipeline

I am trying to figure out the appropriate way to build a pipeline to train a model which includes using the SMOTENC algorithm: Given that the N-Nearest Neighbors algorithm and Euclidian distance are ...
2
votes
2answers
3k views

Passing data to SMOTE after applying train/test split

I'm trying to resample my dataset after splitting it into train and test partitions using SMOTE. Here's my code: ...
2
votes
2answers
2k views

solving multi-class imbalance classification using smote and OSS

I am trying to solve multi-class imbalance classification problem for that i am using SMOTE for oversampling and OSS for under-sampling. But I have a doubt as I am working on multi-class so i have to ...
2
votes
1answer
549 views

Optimizing decision threshold on model with oversampled/imbalanced data

I'm working on developing a model with a highly imbalanced dataset (0.7% Minority class). To remedy the imbalance, I was going to oversample using algorithms from imbalanced-learn library. I had a ...
2
votes
0answers
453 views

DBSMOTE on Short Text Classification

I am trying to use DBSMOTE(Density-Based Synthetic Oversampling TEqnique) to on a data set of short text--tweets to be specific. This will be used to train a classifier model in a multiclass ...
2
votes
0answers
735 views

class imbalance - applied SMOTE - next steps

I am new to ML and learnt a lot from your valuable posts. I need your advise with the following situation and guidance on if the steps make sense. I have a binary classification problem, my dataset ...
1
vote
1answer
3k views

Using SMOTE for Synthetic Data generation to improve performance on unbalanced data

I presently have a dataset with 21392 samples, of which, 16948 belong to the majority class (class A) and the remaining 4444 belong to the minority class (class B). I am presently using SMOTE (...
1
vote
2answers
26 views

How to properly use oversampling without inflating results?

I am using with a tiny private dataset (over 192 samples) with 4 classes. A preprocessing step is trivial in order to do any classification. Among feature selection and extraction techniques, i ...
1
vote
1answer
313 views

Adjust predicted probability after smote

i have an imbalance data set and I used smote to oversample the minority class and undersample the majority class. now, I want to check the test AUC using predict_proba of the model. I have two ...
1
vote
1answer
1k views

SMOTE and standardisation

I have an unbalanced dataset X. I split it between data and labels, then I standardize the data. Then I use train_test_split to split between train and test data and I output the result. Now I want ...
1
vote
2answers
1k views

How to find nearest neighbors in SMOTE

I am reading the original paper by Chawla and others for SMOTE. I am trying to understand how to generate these synthetic examples for over-sampling the minority class. The paper says: "Synthetic ...
1
vote
1answer
139 views

How to use SMOTE in Stacking in SKLearn?

I have a data set X,y and split them to train and test data. ...
1
vote
1answer
260 views

What are the standard parameters values for SMOTE technique?

I'm working on an imbalanced class data set (200 samples) with 2 classes, first class has 50 sample and second has 150 sample. My questions: When I use SMOTE technique on my data set my total ...
1
vote
1answer
103 views

On which step should use SMOTE technique for over sampling?

I want to use SMOTE technique for over sampling but I don't know on which step on pre-processing I should use it. My preprocessing steps are: Missing values Removing Outliers Smoothing Data Should ...
1
vote
1answer
125 views

What are advantages of oversampling over changing threshold for unbalanced classes?

Let's say that I have unbalanced data set that has two classes, and I am using Random Forest to make my predictions. Random forest will be biased towards the majority class, which will cause low ...
1
vote
2answers
2k views

How do I run SMOTE on image data using the packages available?

I need to balance some image datasets, how do I use SMOTE variants or the imblearn SMOTE method with images? I can't figure out how to, since they seem to be working only with numerical datasets.
1
vote
1answer
19 views

SMOTE for multi-instance learning i.e num_rows(x_train) > num_rows(y_train)

I have an imbalanced dataset and I wish to predict classes(0 or 1). Sample x_train: ...
1
vote
1answer
51 views

Class balancing of the dataset

While performing the SMOTE for balancing the class data, what should be the proportion of both class? For instance, if we have 100 instances, what (%) should be the Yes class and what should be the No ...
1
vote
1answer
173 views

SMOTE and oversampling with constraints

I'm trying to apply SMOTE to a dataset that has time-constraints. I have information about users visiting a website. For some features, there are time constraints, e.g having the first visit and the ...
1
vote
1answer
197 views

suggestion to implement undersample and oversample

My dataset has the following class distribution ...
1
vote
0answers
22 views

Training data with one class

I have a real-time scenario, finding out whether a transaction is fraudulent or not. I have a dataset that contains only fraudulent transactions. For any binary classification algorithm, we may need ...
1
vote
1answer
51 views

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

I am working on very imbalanced dataset, I used SMOTEENN (SMOTE+ENN) to rebalance it, the following test is made using Random Forest Classifier : My train and Test ...
1
vote
0answers
140 views

How do I handle class imbalance for text data when using pretrained models like BERT?

I have a skewed dataset consisting of samples of the form: Category 1 10000 Category 2 2000 Category 3 400 Category 4 300 Category 5 100 The dataset ...
1
vote
0answers
34 views

Follow up question regarding Upsampling for Imbalanced Data and the use of ADASYN instead of SMOTE

I have a follow-up question regarding this topic. I have been working on a project predicting success(1) or failure(0) for organizations by using the Decision Tree and Random Forest algorithms. My ...
1
vote
0answers
147 views

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

Here's the thing, I have an imbalanced data and I was thinking about using SMOTE transformation. However, when doing that using a sklearn pipeline, I get an error because of missing values. This is my ...
1
vote
0answers
266 views

Imblanced-data: Need assistance with SMOTE technique for a CNN input

I am trying to apply the SMOTE sampling technique to over-sample the minority class of a multiclass (5-class) problem using the convolutional neural network. As far CNN requirement, the input shape ...