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 [unbalanced-classes]

The tag has no usage guidance.

0
votes
0answers
27 views

XGBoost multiclass class balancing using weight parameter [duplicate]

I have three classes in the target variable with representation ratios of, class A:0.5 class B:0.3 ...
0
votes
1answer
21 views

oversampling data with subclass

Oversampling of under-represented data is a way to combat class imbalance. For example, if we have a training data set with 100 data points of class A and 1000 data points of class B, we can over ...
1
vote
0answers
29 views

Kappa Goes up as Accuracy Goes Down

I have recently been trying to train a randomForest model on a binary outcome with a very uneven class split. 282 control ~82% 63 case ~18% There are a total of 147 predictors that I'm testing for ...
5
votes
1answer
87 views

How to compare two unsupervised anomaly detection algorithms on the same data-set?

I want to solve an anomaly detection problem on an unlabeled data-set. The only information about this problem is that the anomalies population is lower than 0.1%. It should be notice that the size of ...
1
vote
1answer
34 views

What are some possible reasons that your multiclass classifier is classifying alll the classes in a single class?

I have unbalanced classes. Group1 N = 140 Group2 N = 35 Group3 N = 30 I ran the code on this data and all the Groups got classified as Group1. I thought that since group1 is the majority group this ...
0
votes
0answers
30 views

Using logLoss as metric function for highly unbalanced dataset

ihave an highly unbalanced dataset and the caret pacjage only allows me to select accuracy or kappa as performance metric. Is it correct to use a mlogloss function to compute model performance? Do you ...
3
votes
1answer
109 views

Overfitting - how to detect it and reduce it?

I have a side project where I am doing credit scoring using R (sample size around 16k for train data and 4k for test data, and also another two 20k data batches for out-of-time validation) with ...
0
votes
0answers
36 views

Relation between using stratify and class weights for imbalanced classes

I'm working on a multi-class classification problem where the classes are imbalanced (70:25:5). Train-Test Split ...
1
vote
1answer
87 views

Why doesn't class weight resolve the imbalanced classification problem?

I know that in imbalanced classification, the classifier tends to predict all the test labels as larger class label, but if we use class weight in loss function, it would be reasonable to expect the ...
1
vote
1answer
33 views

Regression - Unbalanced Categorical Features

I have a data set that has some unbalanced categorical features. I would like to build a regression model to predict a label using machine learning (ML). How do I handle data imbalances in ...
0
votes
0answers
20 views

Unbalanced data set

Good evening everyone, I'd like to train a dataset for a multiclass classification. The problem is my dataset is very unbalanced. I mean, i have lots of elements from a class and few from another. I'...
1
vote
0answers
18 views

SMOTE caused my total nrows in train to fall to a very small proportion

I have a highly skewed dataset with minority class in target being just about 4%. I decided to apply SMOTE using library DMwR in R. Here is my target: ...
1
vote
1answer
30 views

Audio classification data balance

I'm trying to make a "car sound detector" I have the data from https://urbansounddataset.weebly.com/urbansound.html site. Which has 1000 labeled sounds for 10 different classes(Car sound, dog bark, ...
1
vote
2answers
44 views

Poor performance for unbalanced dataset

Consider a dataset A which has examples for training in a binary classification problem. I have used SVM and applied the weighted method (in MATLAB) since the ...
1
vote
2answers
52 views

Doubt to use accuracy or macro f1 measure in an unbalanced classification task

I have a multi-class classification task where the organizers said that the final results will be using the Accuracy measure. The provided data is unbalanced, and I don't have an idea about the test ...
0
votes
1answer
122 views

Predicting on real test set gives only very high probability for 1 for a very unbalanced data

Excuse me for this brief description of the problem, as I'm very bound on time, I'll try to sum up as much as I can. I have a multivariate time-series, that I trained using an RNN, there are periods ...
0
votes
1answer
65 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:...
3
votes
3answers
542 views

using sklearn class weight to increase number of positive guesses in extremely unbalanced data set?

Hi I have a poorly correlated and unbalanced data set I have to work with. The set is 2 classes, 0 has 96,000 values and 1 has about 200. When I run random forest or other methods I get an output like:...
0
votes
1answer
37 views

Is there any way how to make samples balanced?

I have a dataset which consists of attributes on breakdown of machines.The target variable is machine status which are populated with ones and zeros. The distribution of ones and zeros are given below ...
1
vote
0answers
88 views

Increase Specificity of a model using SMOTE arguments from DMwR package in R when training data is unbalanced

I'm working on a binary classification problem and training data which I'm using is unbalanced. I used SMOTE function from DMwR ...
0
votes
2answers
50 views

Skewed two class data set

Is there any theory on the influence of skew in the data set on the performance of binary classifiers? At work, we are doing abuse detection, the negative population is regular logins, and the ...
2
votes
1answer
37 views

Given data that is labeled as outliers, how can I classify data as outliers?

I have a dataset that is a mixture of sparse binary features and quantitative features. I only have definite outliers labeled. How should I approach trying to classify unlabeled data? I considered ...
1
vote
1answer
114 views

Unblanced classes: classifier only predict one class

I am trying to use a multiclass classification using python. For that I used few algorthims like Random Forest, Xgboost, Logitic regression. My problem is simple, I have users, Images, and people ...
2
votes
0answers
43 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 ...
1
vote
0answers
117 views

How to compute G-mean score?

I would greatly appreciate if you could let me know how to fix the following issue: I used sklearn.metrics.fowlkes_mallows_score to compute G-mean score for my binary classification problem, but it ...
2
votes
0answers
81 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 ...
0
votes
1answer
41 views

Can we make two separate models vs one for classification?

Suppose I have a binary classification problem and my data is imbalanced, I can build a classification model using any of the algorithms and use an oversampling or undersampling technique to handle ...
2
votes
0answers
132 views

Oversampling for multi-class neural net

Does this make sense or do I have no idea what I'm doing? I want to train a model that takes a sentence and outputs a binary multi-class vector of size $K$ where each dimension is a question class. ...
1
vote
1answer
2k views

Using class weights in Keras with multiple binary outputs which are not simply one-hot-encoded

My labels are binary vectors of length 5, e.g., [0, 0, 1, 1, 1]. My label set is very biased, 1-to-50, where the case [0, 0, 0, 0, 0] is very common while all ...
0
votes
1answer
45 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
vote
1answer
66 views

When training an image classifier, is it best practice to equally distribute the number of images in each category?

When training the model, I understand If I supply too many on a certain category, it may become overfitted and treat almost all predictions as the overfitted category. This can lead to false ...
1
vote
1answer
41 views

How to interpret PR and ROC Curve for an unbalanced test set

I have trained a neural network on a dataset, the test set is very unbalanced, ratio between positive examples and negatives is 1:25000. All positive examples are correctly predicted, instead ...
1
vote
2answers
373 views

Random Forest Classifier - KFold CV Tunes Very Deep Trees --> Overfitting?

I'm tuning a random forest in python and am wondering if/why my model is overfit. The dataset is described below: 1700 Positive Cases / 54000 total cases ~ 3.2% (unbalanced) 50 Numerical Features,~...
0
votes
1answer
59 views

Class imbalance strategies

When dealing with the class imbalance problem in a binary classifier, there are three ways I know of to address it: over-sampling, under-sampling and using cost-sensitive methods. Are there any ...
1
vote
1answer
3k views

How can I perform stratified sampling for multi-label multi-class classification?

I am asking this question for few reasons: The dataset in hand is imbalanced I used below code ...
0
votes
2answers
209 views

Dealing with long sequence labeling

I am dealing with a problem in which I have to label the inputs (in a sequence format) to 5 distinct classes. The input would be like: X = {x_1,_x_2,...,X_500} ...
2
votes
1answer
3k views

How to set class-weight for imbalanced classes in KerasClassifier while it is used inside the GridSearchCV?

Could you please let me know how to set class-weight for imbalanced classes in KerasClassifier while it is used inside the ...
2
votes
1answer
341 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 ...
1
vote
2answers
4k views

weighted cross entropy for imbalanced dataset - multiclass classification

I am trying to classify images to more then a 100 classes, of different sizes ranged from 300 to 4000 (mean size 1500 with std 600). I am using a pretty standard CNN where the last layer outputs a ...
0
votes
1answer
40 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: ...
2
votes
1answer
62 views

Class distribution discrepancy training/validation. Loss now uninterpretable?

I have a 3-class image classification problem. The classes are highly unbalanced (with about 98% of the images beloning to one class). To counteract this unbalanced data, I weight the losses by using ...
0
votes
1answer
1k views

Random Forest Classifier Probabilities

My dataset has 140k rows with 5 attributes and 1 Attrition as target variable (value can either be 0 (Customer churn) or 1 (Customer Does not churn)). I divided my dataset in 80% training and 20% ...
3
votes
1answer
94 views

Significant overfitting with CV

I working on a binary classification task. The dataset is quite small ~1800 rows and ~60 columns. There are no duplicates in the rows. I am comparing different classifiers amongst the canonical ones: ...
1
vote
1answer
96 views

Does classification of a balanced data-set lead to any problem?

So I came across a bioinformatics paper, where I found a line which says: One potential problem with using a training set with equal numbers of positive and negative examples in cross-validation ...
1
vote
0answers
380 views

Fraud detection using auto-encoders and Keras

I am following this example to learn a bit about the use of auto-encoders in fraud detection. Now that I reached the end of the article, two questions rose in mind: Can we train the network in an ...
2
votes
2answers
4k 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....
1
vote
1answer
137 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: ...
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 ...
3
votes
2answers
2k views

Why will the accuracy of a highly unbalanced dataset reduce after oversampling?

I have created a synthetic dataset, with 20 samples in one class and 100 in the other, thus creating an imbalanced dataset. Now the accuracy of classification of the data before balancing is 80% while ...
3
votes
1answer
751 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 ...