Questions tagged [class-imbalance]

Questions referring to classifiers or classifying problems where some of the classes in the data are under-represented.

150 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
502 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
145 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
2answers
53 views

Predicting positive/negative experience with very few labels and labels from only one class

I have video viewing data (length of session, nb of videos, etc), as well as if the user clicked on the like button. We can use the like button as a confirmation that the user had a positive viewing ...
3
votes
0answers
678 views

Target mean encoding worse than ordinal encoding with GBDT ( XGBoost, CatBoost )

I have a dataset of 23k rows of an unbalanced dataset 85/15 ratio, 10 variables ( 9 of which are categorical ) , i'm using CatBoost and XGBoost for a binary classification. I applied cv (5 iteration ...
3
votes
0answers
406 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-...
3
votes
0answers
389 views

How to explain a Calibration Plot for many models?

I have a heavy imbalanced dataset with a classification problem. I try to plot the Calibration Curve from the sklearn.calibration package. In specific, I try the ...
3
votes
0answers
359 views

Adjust class weights due to class imbalance and class importance Multi class classification XGBoost

With respect to this question and the answer given by @Esmailian, Would anyone be able to let me know if Class B has a higher importance or the positive class ( i.e. it needs to have a higher ...
3
votes
2answers
813 views

Dealing with biased binary classifier

My training data is weighed heavier on the '1' class, with about a 4:6 ratio. This outputs a classifier that is of 82% accuracy with an emphasis on the '1' class, which makes sense. ...
3
votes
1answer
170 views

Running two stage classification to predict relatively rare event?

I have a very imbalanced sample in which I am trying to predict probability of a rare event (Out of around 25,000 observations, this event is observed around 30 times) and am reluctant to try over/...
3
votes
3answers
134 views

Overfitted model produces similar AUC on test set, so which model do I go with?

I was trying to compare the effect of running GridSearchCV on a dataset which was oversampled prior and oversampled after the training folds are selected. The oversampling approach I used was random ...
3
votes
1answer
61 views

Restrictions on my skewed validation data

I have a severely skewed data sets consisting of 20 something classes where the smallest class contains on the order of 1000 samples and the largest several millions. Regarding the validation data, ...
2
votes
0answers
254 views

Binary classification with imbalanced dataset, about lightgbm output probability distribution

I trained a binary classifier for an imbalanced dataset. I did two experiments: lightgbm classifier, boosting_type='gbdt', objective='cross_entropy', SMOTE upsample After training the lgbm model, I ...
2
votes
0answers
39 views

Is balancing class data for imbalanced problems helpful or just folklore when considering thresholds?

Caveat: I'm aware that imbalanced data questions are a dead horse, but I haven't found an answer to this flavor of it directly. When working with highly imbalanced data (e.g. binary class cases), ...
2
votes
0answers
38 views

Imbalance classes in Named Entity Recognition

I am currently working on a NER problem which attempts to extract 2 entities - place-of-interest(POI) and street from an address string in the Indonesian language. I used IndoBert (available here) and ...
2
votes
1answer
48 views

What's the best way to validate a rare event detection model during training?

When training a deep model for rare event detection (e.g. sound of an alarm in a home device audio stream), is it best to use a balanced validation set (50% alarm, 50% normal) to determine early ...
2
votes
1answer
861 views

Generate a balanced batch with ImageDataGenerator() and flow_from_directory()

Hi I am new to python and deep learning. I am doing a multiclass classification. My 3-classes dataset is imbalanced, the classes take about 50%, 40%, and 20%. I am trying to generate mini batches with ...
2
votes
1answer
172 views

How to estimate the accuracy on a large dataset?

Given that I have a deep learning model(handover from former colleague). For some reason, the train/dev set was missing. In my situation, I want to classify my dataset into 100 categories. The ...
2
votes
0answers
889 views

Data Augmentation techniques for classification of imbalanced time series datasets

Now I have a task to classify the imbalanced time series datasets using ML classifiers, such as Logistic Regression, Decision Tree, SVM, and KNN. I am not allowed to use the Deep Learning tools, such ...
2
votes
0answers
86 views

intercept correction in deep learning

Say I have an imbalanced data set, and I decided to over/undersample it during model training. I would then like to predict on new records but using the original, true imbalance in the classes as an ...
2
votes
2answers
2k views

Solving multi-class imbalance classification using smote and OSS

I am trying to solve a 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 ...
2
votes
1answer
86 views

Unbalanced multi-class : distribution might change as more data come in

I am currently working on a problem of multi-class classification on testing logs data. Basically, I have the context data from tests' execution saved, and want to automate the analysis of the ...
2
votes
0answers
353 views

multi class classification : unbalanced data - good testing results poor prediction results

I have unbalanced dataset with 11 classes where 1 one class is 30% and rest are between 5-12%. I am not a hardcore programmer so I am using the product from https://www.h2o.ai/. I used GBM and DRF ...
2
votes
1answer
281 views

How to weigh imbalanced softlabels?

The target is a probability between N classes, I don't want it to predict the class with the highest probability but the 'actual' probability per class. For example: ...
2
votes
0answers
83 views

Classifying Sequences Where Some Sequences in Both Classes

I am building a modified RNN (specifically a GRU) to classify sequences. These sequences are of variable length, and contain "states". Each point in the sequence is categorical and they look like [A,B,...
2
votes
0answers
738 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
0answers
13 views

Handling imbalanced Feature (X) not lavbel (Y) in machine learning

I am very new to this field and have done a decent amount of research on this, but every time, I stumble upon handling the imbalanced label by using f1 score, recall, precision as metrics, and using ...
1
vote
0answers
10 views

Feature Scaling + Selection when target is imbalanced

If my target is imbalanced, when should I do target balancing in preparation for modeling? Before feature scaling and selection? After feature scaling and selection? If I am doing backward elimination,...
1
vote
1answer
24 views

How to split unbalanced data for supervised learning?

Suppose I have data I want to use for supervised learning, but there is a pretty bad target/class/labels imbalance. Should I: Limit the size of the training set to make sure there is a flat target/...
1
vote
0answers
11 views

What are some strategies to deal with label sparsity when training a protein function prediction model?

The protein function prediction task requires you to take a sequence of amino acids (think words in a sentence, but if there are only 20 words), and output the functions that protein can take. There ...
1
vote
0answers
16 views

Should I use Pad Sequence when using Word Vectors?

I have an unbalanced text data set. I want to use word vectors to embed words. When I use pad sequence? Before or after the word vector? I tried it, after the word vector I used pad sequence but my ...
1
vote
0answers
48 views

GridSearch CV: Suitable scoring metrics for Imbalanced data sets

I am new to machine learning. This is my $1^{st}$ machine learning project and I am working on classification on an imbalanced dataset. There are also multi-classes in the target variable. I would ...
1
vote
0answers
23 views

How does a misrepresented disproportionate data affects modelling?

Let's say I have a dataset of the occurrence of pregnancies each time is tried, the ground truth of success to failure rate is 30:70. But the dataset with me now is a 70:30 dataset. How would that be ...
1
vote
0answers
9 views

Recall/Precision Metrics on Azure AutoML seem to be oriented to majority class, and I'm trying to focus on minority class

I am running some experiments in Azure using AutoML. My problem is a binary classification one, with highly imbalanced classes (basically trying to predict what factors make a deal "WON" ...
1
vote
0answers
72 views

How to pass manually split data to cross-validation

I have to perform a binary classification. My dataset is quite small 280 samples and quite imbalanced (1:10 ratio). I kept around 100 sample as testing and about 140 for training. My input variables ...
1
vote
0answers
33 views

Imbalanced data identification with Shannon entropy

I was studying about the imbalanced data. Then I had a question , how would someone know that which data is imbalanced or not by looking at its percentage(20,30 or 40). Then I read an answer on stack ...
1
vote
0answers
34 views

cost sensitive loss function in lightbm with individual cost

i am looking for a cost sensitive function that will have weights according to individual row feature (like amount) this way i can penalize more FN which has large amount vs. low dollar amount. took ...
1
vote
3answers
83 views

In which situation should we consider a dataset as imbalanced?

I'm facing a problem about making a classification on a dataset. The target variable is binary (with 2 classes, 0 and 1). I have 8,161 samples in the training dataset. And for each class, I have: ...
1
vote
0answers
183 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
44 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
1answer
45 views

Labels as features in anomaly detection

I have a dataset born to solve a classification problem. Due to the imbalances of the Y, i choose to move to an anomaly detection task. Should I use the Y i have inside the anomaly detection model as ...
1
vote
0answers
78 views

Image segmentation with large class imbalance leads to zero precision/recall

I have a binary semantic image classification problem where only very small parts of the images are positive, most of it is negative. In the training data I have a positive rate of around 0.023, which ...
1
vote
0answers
133 views

How can I use the Brier Skill Score in cross-validation for imbalanced data?

I wish to use search for model hyper-parameters (by a grid search) using the Brier score as the scoring method (see code below): ...
1
vote
0answers
42 views

calibrating classifier probabilities for unbalanced data when class ratios are unknown

I've built a binary classification convolutional neutral network, trained on simulated data with equal numbers of simulations for each class. I've obtained good results for a validation set with equal ...
1
vote
0answers
2k views

Image Segmentation Class weight using tensorflow keras

I remember definitely being able to pass a list to class_weight with keras (binary image segmentation specifically). For example: ...
1
vote
1answer
53 views

Appropriate Machine Learning algorithm for modeling clustered time-varying binary outcome

I'll just dive right in. I have a decent-size (100K observations) dataset of time-varying continuous and categorical predictors. Categorical predictors, actually, usually do not change, however, ...
1
vote
1answer
157 views

Cross validation schema for imbalanced dataset

Based on a previous post, I understand the need to ensure that the validation folds during the CV process have the same imbalanced distribution as the original dataset when training a binary ...
1
vote
0answers
21 views

How do I build a model to improve CTR on campaign?

I am trying to build a propensity model for a client to increase the CTR. Client has the list of people who clicked in the previous campaigns but doesn't have the data on the list of people who didn't ...
1
vote
0answers
31 views

How to fix class imbalance in dialogue (text) time series data?

I have a dataset that looks like this: ...
1
vote
0answers
35 views

Identifying possible data leakage

I am building a binary classification model for imbalanced dataset using XGBoost. I tuned the hyperparameters for four different models based on 2 training datasets and 2 optimization metrics. Class ...
1
vote
0answers
77 views

Imbalanced text classification by oversampling: correction of class predicted probability by prior probability

My dataset has 3 class and 900 examples for training. Class distribution is 255, 185, and 460. I found that if I oversample (random) the training data then I have to correct/calibrate the predicted ...