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

The tag has no usage guidance.

0
votes
0answers
4 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 ...
0
votes
0answers
9 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
20 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
31 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
2answers
28 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
29 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
30 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
1answer
29 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 ...
0
votes
0answers
30 views

How to interpret F2 metric based on test set?

I have trained a neural network to detect positive classes in unbalanced data, in my set there are around 1-5% of positive classes. To evaluate my model I have used F2 to ponderate both recall and ...
2
votes
1answer
36 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
77 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
34 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
70 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
57 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
0answers
19 views

Combining features for explainable binary classification, imbalanced dataset with minimal manual checks

I'm building a binary classifier which should detect between "fake" and "genuine" objects for a certain domain. I have designed a dozen of numerical features which are typically large for fake objects,...
0
votes
1answer
39 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
79 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
1k 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
35 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
60 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 ...
0
votes
0answers
16 views

Why is my neural net probability of 'positive' class not exceeding .6 but still have a good separation of data?

I have trained a MLPClassifier (from scikit-learn) to classify a binary signal. The problem is that even though I can find a 'good' threshold to separate the classes (based on predict_proba) the ...
1
vote
1answer
29 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 ...
0
votes
2answers
220 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
50 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
1k 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
91 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
2k 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
260 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 ...
0
votes
2answers
2k 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
36 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
29 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
691 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% ...
0
votes
0answers
368 views

Which imbalance should weights corresponds to in semantic segmentation

I'm semantically segmenting aerial photographs to detect small objects. The amount of pixels in these objects are roughly 2.5 percent of the total pixels in the images, averaged over the complete ...
3
votes
1answer
59 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
58 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 ...
0
votes
0answers
52 views

Regularising a Logistic Regression causes a class imbalance

I am trying to train a multi-class logistic regression model. The dataset is an embedding vector of length 500, which is used as features, and the target is 5 classes 0-4. This model is used in a ...
0
votes
0answers
328 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 ...
1
vote
2answers
2k 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....
0
votes
0answers
523 views

Improve accuracy of text classification using Keras in R

I am trying a text classification model using Keras in R. I am facing trouble in improving my model accuracy on validation data. Any help would be great. Sharing the cleaned file here along with the ...
1
vote
1answer
92 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
846 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
2answers
661 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 ...
1
vote
0answers
431 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
63 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 ...
5
votes
1answer
3k views

How do you apply SMOTE on text classification?

Synthetic Minority Oversampling Technique (SMOTE) is an oversampling technique used in an imbalanced dataset problem. So far I have an idea how to apply it on generic, structured data. But is it ...
3
votes
1answer
151 views

What is the allowable limit of oversampling?

Suppose I have 2 classes. One class has 16 samples and the other class has 435 samples. Is it justified to oversample the class with 16 sample to have a 435 number of samples? Or is it better to ...
1
vote
1answer
49 views

Handle Unbalanced data [closed]

I have a data-set with 2 target classes. In training dataset, the ratio of the 2 classes are 1:93 With my neural network, the current accuracy is 63%. I tried undersampling, oversampling, equal ...
1
vote
0answers
126 views

suggestion to implement undersample and oversample

My dataset has the following class distribution ...
1
vote
1answer
104 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 ...
0
votes
2answers
2k views

Does class_weight solve unbalanced input for Decision Tree?

I've read in sklearn's documentation that we have to take special care in balancing the input for a decision tree, but it doesn't tell you what function to use. However, I've found the parameter ...