Custom multi-label cross-entropy loss that boosts weight of particular errors

I am using XGBoost for a multi-label classification problem (objective is 'multi:softmax' in XGBoost). In my case there are 16 discrete output labels where only one is correct. However, depending on the example, there are particular predicted labels that are close to correct that deserve some sort of partial credit/boost for being closer to the answer than other labels.

I want to see if I can modify the objective/loss function in XGBoost to account for this. The user gets more utility out of a close to correct error than another error. I know how to wire this up mechanically in XGBoost, but I'm trying to find a good example for the actual math one might use in a case like this. For XGBoost you have to return a gradient hessian tuple.

Any similar examples or pointers for further reading would be greatly appreciated! My background is more on the CS/software engineering side than data science/stats.

Topic loss-function xgboost multilabel-classification

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.