Stack Exchange Network

Stack Exchange network consists of 175 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.

1
vote
2answers
44 views

How correctly assign weights to minority class or samples in ANN?

Having an imbalanced dataset. Abnormal class rate is %5. To handle with the problem I have gave extra weight to the abnormal class. However, It did not change anything. Here is my code: ...
3
votes
1answer
42 views

CNN - imbalanced classes, class weights vs data augmentation

I have a set of data with a few strongly imbalanced classes, eg the smallest class is about 54 times smaller than the largest. Therefore, data augmentation in order to equalize the size of classes ...
0
votes
0answers
12 views

Class weights for time-series data with imbalanced classes

I am having an issue where my loss is decreasing on every epoch, but my precision and recall are still extremely small. This is, in my understanding, because I have time-series of length 8639 and each ...
1
vote
1answer
16 views

How do we go about imbalanced data for prediction problem? [duplicate]

As in classification we have imbalanced classes, we use up-sampling or down-sampling and other techniques, what do we do when we have imbalanced data in prediction problems, for example, I have ...
0
votes
1answer
47 views

Using keras with sklearn: apply class_weight with cross_val_score

I have a highly imbalanced dataset (± 5% positive instances), for which I am training binary classifiers. I am using nested 5-fold cross-validation with grid search for hyperparameter tuning. I want ...
1
vote
3answers
81 views

imbalanced dataset in text classififaction

I have a data set collected from Facebook consists of 10 class, each class have 2500 posts, but when count number of unique words in each class, they has different count as shown in the figure Is ...
5
votes
1answer
144 views

Cross validation for highly imbalanced data with undersampling

In my problem, I am dealing with a highly imbalanced data set, say for every positive class there are 10000 negative one. A normal starting method to train a model is to undersample the data. In this ...
2
votes
3answers
345 views

Deep network not able to learn imbalanced data beyond the dominant class

I have data with 5 output classes. The training data has the following no of samples for these 5 classes: [706326, 32211, 2856, 3050, 901] I am using the following keras (tf.keras) code: <...
-1
votes
0answers
28 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
26 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
12 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
38 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
4answers
252 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
59 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:...
4
votes
1answer
61 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
47 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
120 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 ...
1
vote
2answers
179 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
113 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. ...
2
votes
1answer
71 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. ...
2
votes
0answers
356 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
1answer
402 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
25 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 ...
1
vote
1answer
77 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
732 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
34 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 ...
2
votes
1answer
732 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
124 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 ...
1
vote
1answer
1k 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
43 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 ...
-1
votes
0answers
131 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 ...
1
vote
1answer
218 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
87 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
48 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
128 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
197 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
39 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
325 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
465 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
39 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
97 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
448 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
54 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-...
3
votes
1answer
675 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 ...
1
vote
0answers
154 views

suggestion to implement undersample and oversample

My dataset has the following class distribution ...
1
vote
1answer
152 views

Which Classification Metrics Are Appropriate For Each Class Distribution Scenario?

Currently, I have a balanced dataset (that I artificially over-sampled to make it balanced). My classes are binary (0 or 1). I'm wondering if "accuracy" is the "best" metric to use in the situation ...