How to change prediction threshold for binary classification?

phivu
phivu New Altair Community Member
edited November 2024 in Community Q&A

Hi RapidMiner,

 

I'm building a binary classifier using different methods. But i notice that different methods use different thresholds on the confidence(yes) values to decide if the prediction is yes or no. For example, SVM uses 0.5 as the threshold. However, Gradient Boosted Trees (GBT) seems to set the threshold as 0.1. So i'd like to ask if there's a way to change this threshold for GBT, cause this will affect the accuracy computed in the Performance operator (if i could set the threshold as 0.5 for GBT, i will get a higher accuracy).

 

I attached the process together with the trained models and testing data in this message. If you run the process, you will see some records in the prediction result (e.g. row number 368, 471, 529, 573) have confidence(yes) < 0.2 but the predictions are yes.

 

Thanks a lot for your help!

 

Best,
phivu

Best Answer

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓

    Hi phivu,

     

    have a look at the Create andApply Threshold operators. They should do the trick.

     

    ~Martin

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓

    Hi phivu,

     

    have a look at the Create andApply Threshold operators. They should do the trick.

     

    ~Martin

  • phivu
    phivu New Altair Community Member

    This works great, thank you Martin!

     

    phivu