Tabular Data Weighted Custom Loss Function Idea

Hi all, I am currently building a classifier on tabular data to maximize profit. The idea is, for each class, for each correct prediction, you will be awarded X amount of money, penalize Y amount of money for wrong prediction.

image

For instance, predicting class B correctly has a very high reward, otherwise, will be penalized severely as well.

I would like to ask for your idea on how can I customize the loss function such that it will be better than the standard CrossEntropyLoss for this question.

This worked for me:

1 Like