Surely I'm not the first person trying to do this, but can't find a good answer (probably because I'm not searching with the right terms).
I have a problem with 10 balanced classes (0-9) where the error is less important the closer the predicted class is to the actual class (e.g. if true class is 2, I'd rather classify it as 3 than as 8). Essentially, I'd like the confussion matrix to be as centered on the diagonal as possible.
Is there a specific metric/technique that is used in these cases? If so, is it implemented in sklearn or similar?