The default loss function in multi class classification is cross_entropy, which treats all wrong guesses equally. If the distance between buckets are meaningful, for example, given the real bucket is 5, the guess 6 is considered 3 times better than 9, is there such function rewarding better guess? Also I don't want to lose the wights from probabilities as captured by cross_entropy, which is the reason I use rather classification than regression. I can change the formula of cross_entropy a little bit to have it multiplying the distance before summation. But is there already a well established treatment for such a generic needs?
Asked
Active
Viewed 10 times
0
-
Are the categories in some kind of order? – Dave Aug 24 '23 at 17:17
-
Yes. Like Age groups. – jerron Aug 25 '23 at 16:51
-
Then what you’re looking for is called ordinal regression, not classification. Digging deeper, however, do you need to group the ages instead of working with the raw ages? You might have the data reported that way, and that settles it, but some of the links in my profile discuss why binning a variable like age is more problematic than it might appear [(1)](https://stats.stackexchange.com/questions/68834/what-is-the-benefit-of-breaking-up-a-continuous-predictor-variable) [(2)](https://stats.stackexchange.com/questions/41227/justification-for-low-high-or-tertiary-splits-in-anova/41233#41233). – Dave Aug 25 '23 at 16:55