Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [class-imbalance]

The tag has no usage guidance.

0
votes
0answers
20 views

Should the test set be undersampled in a way that mirrors the distribution of the training set?

I have a balanced dataset that I want to "force" an imbalance on. So I've removed some % of the instances of class A from the training set. However, the test set is balanced. In order to get an ...
0
votes
3answers
19 views

Classifying on imbalanced dataset

I have incidents VS normal operation of my working environment. It is a skew dataset. My prediction accuracy is 95%. Question: 1. Is it common practice among data scientist to accept this prediction? ...
1
vote
0answers
7 views

SmoteBoost: Should SMOTE be ran individually for each iteration/tree in the boosting?

As per the paper on SmoteBoost, SMOTE is ran for each iteration of the boosting, generating N samples, which are further added to the original training data and the weight distribution of the ...
1
vote
1answer
20 views

Class imbalance in one hot encoding for CNN

I am building a 2D Convolutional Neural Network for MFCC features for audio classification. The issue I am facing is that there are 2 classes and huge imbalance between them. One class has 17687 ...
0
votes
3answers
79 views

In a binary classification, should the test dataset be balanced?

I have a dataset with 4519 samples labeled as "1", and 18921 samples labeled as "0" in a binary classification exercise. I am well aware that during the training phase of a classification algorithm (...
0
votes
1answer
45 views

Best way to deal with realistically imbalanced dataset for Regression problem

I have a dataset where each object has a label between 0-1. Objects with label = 1 are very common but those with label = 0 are very rare. I am interested in predicting the label in unseen data. NOTE:...
1
vote
0answers
17 views

issue with early-stopping on f1 score with imbalanced data

I have a highly imbalanced dataset with less than 0.5% of the minor class. Using Keras, I'm training DNN on the training set and evaluate performance on validation set. Loss function is ...
1
vote
0answers
8 views

Word frequencies in unbalanced case-control dataset

I have a case-control cohort for which I'm doing analysis of clinical notes. The ratio of cases to controls is 1:4. What I'm looking at is the relative frequency of certain words (e.g. overdose, ...
1
vote
0answers
44 views

How to weight loss in regression

I've got a regression problem where a model is required to predict a value in the range [0, 1]. I've tried to look at the distribution of the data and and it seems that there are more examples with ...
0
votes
3answers
50 views

Downsampling and class ratios

My target variable is whether an application is accepted or not. It is a highly imbalanced target with 98.5% of applications accepted. I am unclear about the concept of downsampling. If I were to ...
0
votes
0answers
11 views

imblearn - how to specify ratios

I'd like to use imblearn to rebalance a data set (as here), but I don't want all classes balanced equally. I'd like to specify the ratios between classes. It ...
0
votes
0answers
30 views

Address Class-Imbalance Dataset using Sampling Techniques on Train, Test Dataset or Both?

I am dealing with an unbalanced dataset and I'm really confused if I should apply sampling techniques, like downsampling, smote, upsampling etc., on the train, test dataset or both? The minority ...
1
vote
2answers
101 views

Which method should be considered to evaluate the imbalanced multi-class classification?

I am working on multiclass-imbalanced data. My dependent variable is highly skewed. ...
0
votes
1answer
59 views

Bidirectional GRU: validation loss stuck on plateau diverges from well performing training loss

tl;dr: What's the interpretation of the validation loss decreasing faster than training loss at first but then get stuck on a plateau earlier and stop decreasing? The accuracy behaviour is similar. ...
1
vote
0answers
44 views

Why does balancing the test dataset improve precision-recall curve?

I have a fairly imbalanced dataset for default-risk credit scoring (2:98). Both costs are fairly important i.e False negative means loss from default and false positive is a lost-revenue opportunity. ...
0
votes
0answers
44 views

R package used for Sampling techinque such as over,Under, both, SMOTE to balance multi-class target variable

given below is an example of my data frame. Target Class 0 0 0 0 0 0 0 1 1 2 3 3 4 1 3 4 Now my target class ...
1
vote
0answers
163 views

How exactly does class_weight in Keras work?

I'm working on a multi-label problem in Keras, using binary-crossentropy loss function with a sigmoid activation. Lets say i have 4 classes, so a response might look like this: ...
0
votes
0answers
53 views

Imbalanced dataset: undersampling or splitting the dataset first?

I am doing a binary classification on an imbalanced data set, like 30:1 ratio for the two categories. One of the basic methods that I've read is to undersample the majority class such that there is ...
0
votes
1answer
253 views

Class weights for imbalanced data in multilabel problems

I am trying to train a CNN for a multiclass - multilabel classification task (20 classes, each sample can belong to 1+ labels) and the dataset is highly imbalanced. In single-label cases I would use ...
0
votes
1answer
24 views

Handling imbalanced data by deleting over represented rows vs. adding under represented rows

I am currently working with a very imbalanced data set (frauded credit card data from kaggle, which has 492 rows of frauded cards and over 280,000 rows of non-frauded cards). As much as I know, there ...
0
votes
0answers
37 views

Are resampling techniques such as SMOTE and ADASYN really a good approach?

I get that resampling techniques are used when there is a class imbalance problem. But the techniques that i mention actually generate synthetic data from the real data. Since the generated data are ...
0
votes
0answers
142 views

How to apply class imbalance techniques on a pyspark.sql.dataframe.DataFrame

I am working on a binary classification model(using RF, logit, and svm) and my data is highly imbalanced, so I am trying to use 'SMOTE' etc techniques for oversampling the minority class. Currently, ...
1
vote
1answer
53 views

bad regression performance on imbalanced dataset

My current dataset has a shape of 5300 rows by 160 columns with a numeric target variable range=[641, 3001]. That’s no big dataset, but should in general be enough for decent regression quality. The ...
2
votes
3answers
408 views

How to handle “unknown” category in machine learning classification problems?

Tutorial problems come in the form of binary or mult-class classification where data are all properly labelled. In real-life applications, there are incoming data that do not belong to any category ...
3
votes
0answers
26 views

Deep Learning: Does starting the training on a smaller subset of the data make sense?

I trained a deep neural network with a small subset of my data, which allowed me to go through many epochs in a short amount of time and allowed the model to perform reasonably, then I gave it the ...
0
votes
0answers
8 views

How many interesting cases do I need in my sample for classification?

I'm trying to construct a binary classification model of a rare event. Let's say I have a sample of 1000 and have the option of dictating what degree of balance I have between both outcomes. What ...
2
votes
1answer
347 views

Macro- or micro-average for imbalanced class problems

The question of whether to use macro- or micro-averages when the data is imbalanced comes up all the time. Some googling shows that many bloggers tend to say that micro-average is the preferred way ...
0
votes
1answer
92 views

Poor Precision-Recall curve for binary classifier trained on balanced data, with imbalanced test data

I have an very imbalanced dataset (9:1), for which I have performed under-sampling and achieved a balanced training set (~130k samples total post balancing). I am performing classification using ...
0
votes
0answers
167 views

Keras: calculate sample_weight? -> accuracy plot wild ups/downs?

I'm on a sequence labeling problem where each word of a sentence should be classified into one of 3 classes (which are one-hot encoded). No generator used. However, one of the 3 classes is naturally ...
1
vote
1answer
828 views

focal loss function help

I am working on a relation extraction and classification problem. The data is in the form of text files. The data is imbalanced. I want to use focal loss function to address class imbalance problem in ...
0
votes
1answer
37 views

How to deal with unbalanced class in biological datasets?

When dealing with unbalanced class, which is better, oversampling/undersampling of the classes or randomly selecting equal number of positive samples and negative samples from the training dataset ...
0
votes
0answers
91 views

Model Selection with Oversampling/ Cross-Validation leads to similar test results in 2 approaches

Quick Intro Sorry for the long read. I added a lot in here because I wanted to describe what I've worked on so far, but I wanted to quickly summarize the issue I've been having, just so you have it ...
0
votes
0answers
122 views

Two different approaches of oversampling data with GridSearchCV leads to similar test results

I was trying to compare two approaches to optimal selection of hyperparameters based on two approaches: 1) Wrong Approach: Oversampling before GridSearch CV This can lead to bleeding of data (that ...
1
vote
1answer
150 views

Poor performance of SVM after training for rare events

I found out that Weighted SVM is a classification approach to handle class imbalance problem. My data set is highly imbalanced with rare event (minority class, labeled as 1) and the majority class (...
1
vote
0answers
52 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/...
2
votes
1answer
45 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 ...
2
votes
3answers
110 views

Hyperparameter Optimization for a Machine Learning Algorithm

I have a question regarding Hyperparameter Optimization for a Machine Learning Algorithm. I try to fit a Support Vector Classifier and use Hyperparameter-Tuning (but it could be also another ...
9
votes
1answer
190 views

Categorization of approaches to deal with imbalanced classes

What is the best way to categorize the approaches which have been developed to deal with imbalance class problem? This article categorizes them into: Preprocessing: includes oversampling, ...
2
votes
1answer
37 views

Changing multiple models into 1 model

I am working for a recruitment company on developing machine learning algorithms to automatically classify job applicants as either to be interviewed or not be interveiwed. The data is highly ...
2
votes
1answer
285 views

Class Imbalance Problem

I'm making a multiclassifier model with 5 classes. (it is not important in my question whether it has 2 classes or 5 classes, though). class distribution is very imbalanced. So, I did resampling for ...
4
votes
1answer
372 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 ...
0
votes
1answer
38 views

Setting class-weights in a batch in where a certain class is not present

I'm handling a high imbalanced dataset, thus, I'm weighing the loss function in order to penalize the misclassification of the minority classes, I set the weights in each batch as follows: ...
1
vote
1answer
91 views

Right ML mode and metric to minimize FN and FP on imbalanced dataset

So I have a dataset in which I have to predict class binary label (1 or 0), the problem, out of 120k data points, only 200 have the label '1'. the aim is to minimize FN and FP. Which ML model should ...
1
vote
1answer
360 views

Scripting code for class imbalance in Biolabs Orange

I'm trying to manipulate some data in Biolabs Orange, using the built in Python Script widget and information at Biolabs Orange tutorial on scripting. However, I'm struggling with taking the results ...
1
vote
1answer
53 views

Estimating test AUC using k-fold CV for imbalanced classification problem

I have an imbalanced classification problem. I first partitioned my data into a training set (Dataset A) and a test set (Dataset B). I then used the R package ...
1
vote
2answers
3k views

Creating Balanced Dataset Using Scikits

I have a classic User-Item dataset where each row (i.e., (user, item)) indicates the action of a user clicking/selecting an item....
7
votes
2answers
1k views

How to fix class imbalance in training sample?

I was very recently asked in a job interview about solutions to fix an imbalance of classes in the training dataset. Let's focus on a binary classification case. I offered two solutions: oversampling ...
2
votes
1answer
3k views

What is the best way to deal with imbalanced data for XGBoost? [closed]

There are a lot of way to deal with class-imbalanced data like undersampling, oversampling, changing cost function etc. https://machinelearningmastery.com/tactics-to-combat-imbalanced-classes-in-...
1
vote
0answers
497 views

When should you balance a time series dataset?

I'm training a machine learning algorithm to classify up/down trends in a time series and I'm using an imbalanced feature set. It seems necessary to balance the data since the algorithm could learn a ...
0
votes
0answers
69 views

Imbalanced data set: How to speed up synthetic minority oversampling technique, for highly dimensional data?

I am trying to over-sample/under-sample the minority/majority class respectively, for an imbalanced data set containing around 2 million rows with 40 columns, and would like to generate a balanced ...