Normalized After the Fact

Three classes, fit one-vs-rest. For one row the three independently trained binary models output p(A)=0.8p(A) = 0.8, p(B)=0.5p(B) = 0.5 and p(C)=0.1p(C) = 0.1: nothing ties them together, so they sum to 1.4.

ovr = OneVsRestClassifier(LogisticRegression()).fit(X, y)
print(ovr.predict_proba(x)[0], ovr.predict_proba(x)[0].sum())

scikit-learn documents that in the single-label multiclass case the rows of predict_proba sum to 1. What prints, and how does it differ from a softmax model?

A

It raises an error: predict_proba is undefined for OneVsRestClassifier, because the per-class models are fit separately and have no shared normalizer.

B

[0.571 0.357 0.071] 1.0: the three independent scores are divided by their sum after the fact. A softmax model normalizes inside its objective instead, so the classes compete with each other during training.

C

[0.8 0.5 0.1] 1.4: one-vs-rest never normalizes, which is exactly why its outputs are not probabilities.

D

[0.8 0.5 0.1] 1.0: the printed sum is 1.0 because of floating-point rounding in the display, while the values are the raw per-class probabilities.