GUVI
Back

How to write customized loss functions separately for false positives and false negatives?

Created 3 years ago
68 Views
0 Comments
Guvigeek
@Guvigeek
Guvigeek
@GuvigeekProfile is locked. Login

So if you have a loss function, the loss function tries to model how much to penalize a model for getting something wrong, right. And something wrong could be up of two classes, it could be either be a false positive, meaning, you said that this particular thing, let's say you're looking at a cancer cell, and you are required to say, Is it is it malignant or benign and malignant, contains cancer while benign, no cancer? Then if you say yes, and actually was not true, then that's considered a false positive. And if you say it is not, not having not been malignant, but actually it was, then that's called a false negative. As you can imagine, the false positive is probably not that bad. It's also not, it's also bad because we are giving a wrong answer, but it's not as bad as a false negative. false negative means, actually, there is cancer, and it says that it doesn't contain, that's really bad, right. And so you might want to have a greater loss or greater penalties for false negatives than false positives. Now, this is not very hard to do. So you can look at your output that you're getting, which is why typically models despise, and there's some ground truth with spite and, and then depending on these two values, you can write any function. So you can, you can have, so in this case, y environment will be just Boolean values. And for all the different four cases, you can put different functions and combinations. In fact, this is what we do when we do something like a cross entropy loss, we actually have different terms for the different values of y. So loss function can be the sum of multiple functions, and each of these sum terms can be for false positives and false negatives. Yes, I'm just giving a top level idea. I think detail is a bit harder to do in this kind of performance.

Comments
Please login to comment.
 
Powered by habitate.io Habitate