Scikit-learn predict_proba gives wrong answers

前端 未结 3 1865
悲哀的现实
悲哀的现实 2020-12-02 11:28

This is a follow-up question from How to know what classes are represented in return array from predict_proba in Scikit-learn

In that question, I quoted the followin

3条回答
  •  甜味超标
    2020-12-02 12:02

    if you use svm.LinearSVC() as estimator, and .decision_function() (which is like svm.SVC's .predict_proba()) for sorting the results from most probable class to the least probable one. this agrees with .predict() function. Plus, this estimator is faster and gives almost the same results with svm.SVC()

    the only drawback for you might be that .decision_function() gives a signed value sth like between -1 and 3 instead of a probability value. but it agrees with the prediction.

提交回复
热议问题