1. Home
  2. Data Science
  3. Scikit-learn
  4. How does predict_proba differ from decision_function?

Added 30 Nov -0001

How does predict_proba differ from decision_function?

  1. predict_proba returns normalised class probabilities summing to one, while decision_function returns unbounded signed distances to the decision boundary Correct answer
  2. decision_function returns probabilities between zero and one, while predict_proba returns raw margins, so the two names are swapped in most of the documentation
  3. Both return probabilities, but predict_proba is only for regressors while decision_function is only for classifiers, so neither applies here
  4. predict_proba is available on every estimator, while decision_function is not, which is why predict_proba is the preferred interface for scoring

Correct answer

A. predict_proba returns normalised class probabilities summing to one, while decision_function returns unbounded signed distances to the decision boundary

17 views

MCQSEXAM

Explanation

Confidence outputs: predict_proba applies the model's link function, such as a logistic sigmoid or softmax, producing scores between 0 and 1 that sum to one across classes. decision_function exposes the underlying margin, which is unbounded and convenient for ranking or thresholding before conversion. Some estimators, notably SVC with probability=False, offer only decision_function.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs