Linked Questions

3 votes
4 answers
5k views

How to deal with class imbalance in a neural network?

Suppose we have a game and its action space contains two possible actions: A and B. We have a labelled dataset of state-action ...
2 votes
2 answers
150 views

Imbalanced training set vs smaller balanced training set?

Say I am using a maximum likelihood approach and my output unit computes a softmax function. My training set is distributed as follows over 6 classes: ...
2 votes
3 answers
5k views

Imbalanced Dataset (Transformers): How to Decide on Class Weights?

I'm using SimpleTranformers to train and evaluate a model. Since the dataset I am using is severely imbalanced, it is recommended that I assign weights to each ...
0 votes
0 answers
48 views

Image classification with CNNs

I created an image classification model using CNNs for 235 classes and I got 71% accuracy on the test set. My dataset contains some classes with more than 1000 images and others with 30 images. For ...
13 votes
6 answers
14k 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: <...
2 votes
1 answer
247 views

Deep learning with Imbalanced classes [duplicate]

I am trying to model a packet data with 1 dimensional CNN but I have a very imbalanced classes in my target. I have 3 classes as class 0 has 53000 cases, class 1 has 300 cases and class 2 has 150 ...
0 votes
2 answers
125 views

When to use GAN over conventional sampling methods?

Let's say I have a dataset from a diabetes hospital which has 30000 Type 2 diabetes and 300 Type 1 diabetes patients. So this dataset has millions and millions of other data points like lab ...
0 votes
1 answer
35k views

TypeError: unsupported operand type(s) for *: 'float' and 'dict_values'

I'm attempting to compute the class_weights for an highly imbalanced set of 9 classes based on the examples discussed in How to set class weights for imbalanced classes in Keras?. Here is the code: <...
4 votes
1 answer
3k views

How to balance class weights correct for a CNN in Keras, given an unbalanced data set?

I want to use class weights for training a CNN with a imbalanced data set. The question arise if the sum of the weights of all examples have to stays the same? My previous plan was to use the ...
10 votes
2 answers
13k views

How to plot learning curve and validation curve while using pipeline

I would appreciate if you could let me know in the following example code: ...
2 votes
0 answers
2k views

Training multi-label classifier with unbalanced samples in Keras

I'm trying to train a keras model that takes in samples, let's say $x_i$ for sample $i$, and predicts multiple independent labels, $\hat{y}_{ij}$, such that $\hat{y}_{ij} = 1$ if the model predicts ...
1 vote
1 answer
4k views

How to set class weights for imbalanced classes in Tensorflow? [closed]

Do we have an equivalence for the following question, but with tensorflow : How to set class weights for imbalanced classes in Keras? ??
6 votes
1 answer
12k views

Setting class weights for categorical labels in Keras using generator

I'm working on with an imbalanced dataset in Keras, and would like to give a higher weight to the samples from my minority class. The fit() function has a nice <...
2 votes
3 answers
3k views

Why MLP only learns bias for unbalanced binary classification?

I just started training a MLP model on a data set which has the following statistics. Notice that both train and validation sets are unbalanced (88.4% negatives). Note: The unbalance isn't caused by ...