I am trying to build logistic regression that will work with unbalanced data, i.e. I have about 0.33% of data parts that have to be classified as class 1 and others that have to be classified as 0.
The question is how should be standard binary crossentropy loss (https://en.wikipedia.org/wiki/Loss_functions_for_classification#Cross_entropy_loss) changed in order to cope with such data?
I tried adding weight to the first part - 1 class, equal to inverted frequency of the 1 class; adding weights to both parts equal to percentage of 0 class for the first part and 1 class to the second class; but nothing seems to work