Different result with roc_auc_score() and auc()

前端 未结 3 1232
挽巷
挽巷 2020-12-07 12:07

I have trouble understanding the difference (if there is one) between roc_auc_score() and auc() in scikit-learn.

Im tying to predict a bina

3条回答
  •  一生所求
    2020-12-07 12:39

    predict returns only one class or the other. Then you compute a ROC with the results of predict on a classifier, there are only three thresholds (trial all one class, trivial all the other class, and in between). Your ROC curve looks like this:

          ..............................
          |
          |
          |
    ......|
    |
    |
    |
    |
    |
    |
    |
    |
    |
    |
    |
    

    Meanwhile, predict_proba() returns an entire range of probabilities, so now you can put more than three thresholds on your data.

                 .......................
                 |
                 |
                 |
              ...|
              |
              |
         .....|
         |
         |
     ....|
    .|
    |
    |
    |
    |
    

    Hence different areas.

提交回复
热议问题