📏  Per-class Precision (sometimes called class-wise precision)

Per-class Precision (sometimes called class-wise precision)#

Precision computed separately for each class.

Important

✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.

What it is#

Per-class precision is precision computed separately for each class, treating that class as the positive one and everything else as negative (one-vs-rest). For class \(c\) it is

\[\text{precision}_c = \frac{TP_c}{TP_c + FP_c},\]

answering of everything predicted as class c, how much really was c?

Why report it#

A single averaged number can hide a class the model handles badly; per-class precision exposes exactly which classes suffer false positives. In scikit-learn, precision_score(average=None) returns the whole array of per-class values.

Its role#

Per-class precision is the building block that micro, macro and weighted averaging then collapse into one score. Best practice is to report the per-class values alongside any aggregate.


Theme: Classification & Averaging Metrics  ·  All terminology



See also

Source article Adapted (context, re-expressed) in our own words from: Per-class Precision (sometimes called class-wise precision) (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: intermediate