I have a model that predicts the level of injury over 3 classes: Low, Medium and High. I wish to optimize the model parameters on the scoring basis of precision. However, precision is class specific, we can determine the precision of low, medium and high separately. Is there a way to determine something like "Overall Precision" from the confusion matrix?

  • $\begingroup$ Yes I do know about the F1 Score, however it is a function of precision and recall, which in turn are class specific again, so doesn't really solve my problem. Is it a good way to maximize precision of all classes by optimizing parameters on the basis of average precision of all classes? $\endgroup$ Mar 24, 2018 at 7:16
  • 1
    $\begingroup$ The following link might be helpful: stats.stackexchange.com/questions/51296/… $\endgroup$ Mar 25, 2018 at 3:04
  • $\begingroup$ "Overall Precision" could be computed as numberb of correctly predicted cases (TP+TN) / total nb of cases (TP+TN+FP+FN). $\endgroup$
    – Malo
    Sep 4, 2021 at 13:35

1 Answer 1


Model parameters are only optimized through the loss function. Precision is not an useful loss function so precision can not be used to optimize model parameters.

Hyperparameters can be optimized with precision through cross-validation.

There are many types of multi-class precision, especially if there are class imbalances. Python's scikit-learn package lists five types: micro, macro, samples, weighted, binary.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.