Classification

Classification predicts a discrete class label. The model usually outputs a probability distribution over classes, then a decision rule converts that distribution into a class.

For classes, logits become probabilities through softmax:

The predicted class is:

The standard supervised loss is cross-entropy:

For binary classification, this becomes:

For a binary logit , the probability is:

The logit is not a probability. It is an unbounded score that becomes a probability only after the sigmoid or softmax link function.

Empirical Risk

For a labeled dataset , classification training often minimizes:

If classes are imbalanced, a weighted objective may be used:

The weights change the training objective. They do not automatically fix the decision threshold or evaluation metric.

Decision Rule

Probabilities and decisions are different. A threshold converts a probability into a label:

Changing changes precision, recall, false positives, and false negatives without changing the model itself.

For binary classification:

Predicted / True
true positivefalse positive
false negativetrue negative

Common decision metrics include:

The threshold should be selected on validation data and reported with the metric.

Multi-Label Case

If labels are not mutually exclusive, each class often uses an independent sigmoid:

This is different from softmax classification, where probabilities compete across classes.

Calibration Boundary

A classifier can rank examples correctly while reporting overconfident probabilities. Calibration asks whether predicted probabilities match observed frequencies:

Calibration matters when probabilities drive decisions, risk estimates, uncertainty filtering, or downstream expected utility. If only ranking matters, ranking metrics may be more relevant than probability calibration.

Task Variants

VariantOutputCaution
binaryone probability or logitthreshold controls decision behavior
multiclassone of mutually exclusive classessoftmax assumes competition
multi-labelindependent label vectorper-class thresholds and label correlations matter
ordinalordered categoriestreating labels as unordered may waste structure
hierarchicaltaxonomy path or nested labelsparent-child consistency may be required

Checks

  • Are labels mutually exclusive, multi-label, ordinal, or hierarchical?
  • Is class imbalance severe enough to require weighting or threshold tuning?
  • Does train/validation/test prevalence match the deployment decision?
  • Are probabilities calibrated, or only rankings/classes needed?
  • Does the split prevent near-duplicate examples from crossing train and test?
  • Is the selected threshold fixed before test evaluation?
  • Does the reported metric reflect the cost of false positives and false negatives?
  • Are logits, probabilities, rankings, and final labels kept distinct?