0
$\begingroup$

After training my CatBoostClassifier model I call get_proba function which returns me list of probabilities. The problem starts from an another point... I transfer that data into dataframe then to Excel after what I sum all float numbers in my list and get numbers approximately equal to 2.

(Example: 0,980831511 0,99695788 2,99173E-13 1,63919E-15 7,35072E-14 4,82846E-16 . Their sum is equal to 1,977789391 )

Parameters which were used:

'loss_function': 'MultiClassOneVsAll', 
 'eval_metric': 'ZeroOneLoss',

The problem is that I need to get dependant type of probabilities, so I get something more like: 0.2 0.5 0.1 0.2 where their sum will be equal to 1 and the highest probability (which might be obvious) is in the second category (which equals to 0.5)

$\endgroup$
2
  • 1
    $\begingroup$ Welcome to DataScienceSE. Why do use MultiClassOneVsAll? Normally this means that you're doing multi-label classification, not multiclass classification. As a result, the classes are predicted independently from each other. If you want to obtain dependent posterior probabilities and a single class predicted for each instance, you should used the standard multiclass setting (one vs rest). $\endgroup$
    – Erwan
    Dec 16, 2022 at 12:03
  • $\begingroup$ @Erwan thanks a lot. Will try it now and say how it went :) $\endgroup$ Dec 16, 2022 at 12:31

1 Answer 1

0
$\begingroup$

Well, I've completed several tests and here is what I got... First of all, I've used different objectives aka loss functions and metrics, so if you need to get "dependant" probability you may use everything (If I am not right, correct me in comment section or wherever else :) ), but loss_function multiclassova (in other words OneVsAll). Anyway, I've used multiclassova as eval metric and everything seemed right... (In case something goes wrong, I will edit or add comment to this answer)
In case you use OneVsAll (if someone doesn't know) you get this result Using multiclassova

In other case, as you see, sum of all events equals to 1, while in last case it could vary from 0.5 to 2.0 Using other loss_function

Again thanks for clarifying @Erwan, because I didn't notice such a silly mistake :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.