Probability-based classification
Thresholds, calibrated probabilities and cross-entropy loss.
A probabilistic classifier outputs , and you turn it into a decision with a threshold : predict positive if . 0.5 is the default, but not always the best.
Change the threshold to reflect costs. For cancer screening, a missed case is far worse than a false alarm, so lower to catch more positives (higher recall, lower precision). For spam, flagging a real email is costly, so raise .
Calibration means the probabilities are honest: of all emails given 0.8, about 80% really are spam. Logistic regression is usually well calibrated; trees, SVMs and deep networks often are not and can be fixed with Platt scaling or isotonic regression.
The loss used for probabilities is cross-entropy: . It rewards confidence when right and punishes confident mistakes severely.
Formula to remember
Softmax
K scores to K probabilities that sum to 1.