Suppose I have classes A,B,C and some predictors.

I want to minimize the loss function where the loss penalties are arbitrary penalties applied to each possible misclassification e.g.:

$$L = \begin{bmatrix}0 & 1 & 2 \\ 5 & 0 & 10 \\ 10 & 100 & 0 \end{bmatrix} $$

So the loss is simply

$$\min_f l = \sum_i L_{f(X_i),y_i}$$

The idea is that in the business application, misclassifying an A as a B isn't so bad (1), but, misclassifying a C as a B is disastrous (100).

What is this family of loss functions called and can it be implemented for any classifiers with standard libraries like scikit-learn?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.