Questions tagged [unbalanced-classes]

Data organized into discrete categories or *classes* may present problems for certain analyses if the number of observations ($n$) belonging to each class is not constant across classes. Classes with unequal $n$ are *unbalanced*.

Filter by
Sorted by
Tagged with
91
votes
3answers
85k views

Does an unbalanced sample matter when doing logistic regression?

Okay, so I think I have a decent enough sample, taking into account the 20:1 rule of thumb: a fairly large sample (N=374) for a total of 7 candidate predictor variables. My problem is the following: ...
69
votes
6answers
15k views

When is unbalanced data really a problem in Machine Learning?

We already had multiple questions about unbalanced data when using logistic regression, SVM, decision trees, bagging and a number of other similar questions, what makes it a very popular topic! ...
29
votes
0answers
666 views

Are unbalanced datasets problematic, and (how) does oversampling (purport to) help? [duplicate]

TL;DR See title. Motivation I am hoping for a canonical answer along the lines of "(1) No, (2) Not applicable, because (1)", which we can use to close many wrong questions about unbalanced datasets ...
28
votes
6answers
90k views

Sample size for logistic regression?

I want to make a logistic model from my survey data. It is a small survey of four residential colonies in which only 154 respondents were interviewed. My dependent variable is "satisfactory transition ...
36
votes
1answer
9k views

Does down-sampling change logistic regression coefficients?

If I have a dataset with a very rare positive class, and I down-sample the negative class, then perform a logistic regression, do I need to adjust the regression coefficients to reflect the fact that ...
48
votes
4answers
24k views

Class imbalance in Supervised Machine Learning

This is a question in general, not specific to any method or data set. How do we deal with a class imbalance problem in Supervised Machine learning where the number of 0 is around 90% and number of 1 ...
39
votes
3answers
3k views

What is the root cause of the class imbalance problem?

I've been thinking a lot about the "class imbalance problem" in machine/statistical learning lately, and am drawing ever deeper into a feeling that I just don't understand what is going on. ...
56
votes
7answers
30k views

Binary classification with strongly unbalanced classes

I have a data set in the form of (features, binary output 0 or 1), but 1 happens pretty rarely, so just by always predicting 0, I get accuracy between 70% and 90% (depending on the particular data I ...
28
votes
4answers
5k views

What problem does oversampling, undersampling, and SMOTE solve?

In a recent, well recieved, question, Tim asks when is unbalanced data really a problem in Machine Learning? The premise of the question is that there is a lot of machine learning literature ...
47
votes
5answers
44k views

Training a decision tree against unbalanced data

I'm new to data mining and I'm trying to train a decision tree against a data set which is highly unbalanced. However, I'm having problems with poor predictive accuracy. The data consists of students ...
14
votes
2answers
9k views

Why P>0.5 cutoff is not “optimal” for logistic regression?

PREFACE: I don't care about the merits of using a cutoff or not, or how one should choose a cutoff. My question is purely mathematical and due to curiosity. Logistic regression models the posterior ...
16
votes
3answers
21k views

SVM for unbalanced data

I want to attempt to use Support Vector Machines (SVMs) on my dataset. Before I attempt the problem though, I was warned that SVMs dont perform well on extremely unbalanced data. In my case, I can ...
10
votes
6answers
25k views

Logistic regression is predicting all 1, and no 0

I am running an analysis on the probability of loan default using logistic regression and random forests. When I use logistic regression, the prediction is always all '1' (which means good loan). ...
20
votes
2answers
15k views

The order of variables in ANOVA matters, doesn't it?

Am I correct to understand that the order in which variables are specified in a multifactorial ANOVA makes a difference but that the order does not matter when doing a multiple linear regression? So ...
6
votes
2answers
3k views

Rare Events Logistic Regression

Suppose the event of interest occurs in approximately $10 \%$ of the cases where the number of cases is around $5,000$. Should you use a penalized logistic regression for this or is regular logistic ...
7
votes
1answer
1k views

Are unequal groups a problem for one-way ANOVA?

I have data for three unequal groups: $N = 44$, $N = 354$ and $N = 347$. Is it possible to compare all three groups running a one-way ANOVA or is the first group too small?
19
votes
2answers
15k views

Testing Classification on Oversampled Imbalance Data

I am working on severely imbalanced data. In literature, several methods are used to re-balance the data using re-sampling (over- or under-sampling). Two good approaches are: SMOTE: Synthetic ...
21
votes
3answers
10k views

ROC vs Precision-recall curves on imbalanced dataset

I just finished reading this discussion. They argue that PR AUC is better than ROC AUC on imbalanced dataset. For example, we have 10 samples in test dataset. 9 samples are positive and 1 is ...
8
votes
2answers
5k views

Does a big difference in sample sizes together with a difference in variances matter for a t-test (or permutation test)?

There is a very confusing question in my mind. I have data, and would like to compare numeric scores between men and women. There is a big difference in those two groups: the number of men is 34, ...
8
votes
3answers
10k views

What balancing method can I apply to a imbalanced data set?

I'm trying to solve one classification problem from the UCI database repository. Unfortunately (or fortunately), I've noticed that my dataset is imbalanced. I've structured the data as 5 classes, ...
35
votes
4answers
30k views

When should I balance classes in a training data set?

I had an online course, where I learned, that unbalanced classes in the training data might lead to problems, because classification algorithms go for the majority rule, as it gives good results if ...
27
votes
3answers
27k views

Classification/evaluation metrics for highly imbalanced data

I deal with a fraud detection (credit-scoring-like) problem. As such there is a highly imbalanced relation between fraudulent and non-fraudulent observations. http://blog.revolutionanalytics.com/2016/...
16
votes
3answers
10k views

Suggestions for cost-sensitive learning in a highly imbalanced setting

I have a dataset with a few million rows and ~100 columns. I would like to detect about 1% of the examples in the dataset, which belong to a common class. I have a minimum precision constraint, but ...
7
votes
2answers
15k views

What is the correct formula for between-class scatter matrix in LDA?

At one point in the process of applying linear discriminant analysis (LDA), one has to find the vector $v$ that maximizes the ratio $vBv'/vWv'$, where $B$ is the "between-class scatter" matrix, and $W$...
4
votes
1answer
7k views

Downsampling vs upsampling on the significance of the predictors in logistic regression

I've been trying to build a binary classification model using multivariate logistic regression using the caret package in R. My dataset consists of around 20000 observations from which >99% belongs to ...
32
votes
4answers
13k views

Optimising for Precision-Recall curves under class imbalance

I have a classification task where I have a number of predictors (one of which is the most informative), and I am using the MARS model to construct my classifier (I am interested in any simple model, ...
7
votes
3answers
16k views

How to deal with a skewed class in binary classification having many features?

I am doing data analysis in the mobile ad targeting domain. I have around 18 features and for a combination of these features, the result is either True or False (1/0) depending on whether the ...
9
votes
1answer
7k views

Best way to handle unbalanced multiclass dataset with SVM

I'm trying to build a prediction model with SVMs on fairly unbalanced data. My labels/output have three classes, positive, neutral and negative. I would say the positive example makes about 10 - 20% ...
6
votes
3answers
10k views

LibSVM cost weights for unbalanced data doesn't work

I have a dataset where the number of negative labeled values is 163 times the number of positive labeled values. That is, I have an unbalanced data set. I tried: ...
3
votes
1answer
905 views

Purpose of class balancing

I see people doing class balancing (via oversampling, etc.) before learning classifiers all the time. I wanted to know why does class balancing improve classification accuracy. Is it true all the time....
3
votes
1answer
98 views

How are artificially balanced datasets corrected for?

I came across the following in Pattern Recognition and Machine Learning by Christopher Bishop - A balanced data set in which we have selected equal numbers of examples from each of the classes would ...
23
votes
2answers
8k views

How to handle the difference between the distribution of the test set and the training set?

I think one basic assumption of machine learning or parameter estimation is that the unseen data come from the same distribution as the training set. However, in some practical cases, the distribution ...
28
votes
6answers
18k views

Sampling for Imbalanced Data in Regression

There have been good questions on handling imbalanced data in the classification context, but I am wondering what people do to sample for regression. Say the problem domain is very sensitive to the ...
14
votes
1answer
5k views

When over/under-sampling unbalanced classes, does maximizing accuracy differ from minimizing misclassification costs?

First of all, I would like to describe some common layouts that Data Mining books use explaining how to deal with Unbalanced Datasets. Usually the main section is named Unbalanced Datasets and they ...
14
votes
2answers
13k views

Does Support Vector Machine handle imbalanced Dataset?

Does SVM handles imbalanced dataset? Is that any parameters (like C, or misclassification cost) handling the imbalanced dataset?
7
votes
3answers
24k views

Handling unbalanced data using SMOTE - no big difference?

I have a classification problem with 2 classes. I have nearly 5000 samples, each of which is represented as vector with 570 features. The positive class samples are nearly 600. Meaning, I have a 1:8 ...
2
votes
2answers
6k views

Multi-class classification with imbalanced classes

I have a data from 5 classes and I would like to build a classifier. However the number of feature vectors in each class is very different. One has about 5000, one about 200,000, one about 1,000,000,...
9
votes
1answer
4k views

A priori selection of SVM class weights

I remember seeing/reading somewhere that for multiclass SVMs with unbalanced data, there was a way to determine the class weights from the training data (rather than X validation). Does anyone know ...
5
votes
2answers
5k views

Random Forests overfitting/unbalanced classes?

Suppose I am using random forests where the classes are highly unbalanced. How do you detect over fitting and what can you do to avoid it? Breiman says in his paper that random forests do not overfit, ...
5
votes
2answers
859 views

Can a classifier trained with oversampled data be used to classify unbalanced data

I am developing a random forest model for predicting fraudulent credit card transactions. I have made a train and test split in my dataset, and finally chosen a model through different metrics, ...
0
votes
1answer
864 views

problems in doing logistic regression with unbalanced sample, give me some references [duplicate]

I have a dataset with lots Y=0 and few Y=1. I have to run logistic regression, so I'm using a retrospective sample in order to get a more balanced sample. Could someone give me some references that ...
3
votes
1answer
2k views

Is there an optimal loss function for dealing with imbalanced classes?

I'm aware that there are many ways of dealing with datasets where there is a strong class imbalance in the target variable: downsampling the more prevalent and less important class, over-weighting the ...
2
votes
1answer
1k views

Denominator is Zero for Matthews correlation coefficient and F-measure

Recently, I built a classification model based on the imbalanced data set(positive sample is minority and negative sample is majority), and the model gave the following result for the test set: True ...
3
votes
1answer
449 views

Text Classification with Huge Classes

I have a problem of text classification with only one text description column as predictor. The classes runs into 1500+ categories. Can someone suggest which algorithm will work best for this text ...
34
votes
4answers
59k views

What is the proper usage of scale_pos_weight in xgboost for imbalanced datasets?

I have a very imbalanced dataset. I'm trying to follow the tuning advice and use scale_pos_weight but not sure how should I tune it. I can see that ...
23
votes
2answers
41k views

Adding weights to logistic regression for imbalanced data

I want to model a logistic regression with imbalanced data (9:1). I wanted to try the weights option in the glm function in R, but I'm not 100% sure what it does. ...
12
votes
3answers
20k views

High Recall - Low Precision for unbalanced dataset

I’m currently encountering some problems analyzing a tweet dataset with support vector machines. The problem is that I have an unbalanced binary class training set (5:2); which is expected to be ...
8
votes
1answer
1k views

Softmax regression bias and prior probabilities for unequal classes

I'm using Softmax regression for a multi-class classification problem. I don't have equal prior probabilities for each of the classes. I know from Logistic Regression (softmax regression with 2 ...
6
votes
2answers
5k views

Classification with a neural network when one class has disproportionately many entries

I try to train a neural network using a dataset with several classes $c_1, c_2, \dotsc, c_{10}$. The class $c_1$ has a lot more entries in the training set than the other classes, and this makes my ...
7
votes
2answers
12k views

By using SMOTE the classification of the validation set is bad

I want to do classification with 2 classes. When I classify without smote I get: ...