# Can I output the probability in a classification mission using a binary classification model?

**URL:** <https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965>\
**Category:** TMVA\
**Created:** [July 22, 2021, 10:00am UTC](https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965 "2021-07-22T10:00:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![melodynk](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ba9def/32.png) [@melodynk](https://root-forum.cern.ch/u/melodynk)\
**Post date:** [July 22, 2021, 10:00am UTC](https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965/1 "2021-07-22T10:00:39Z")

</div>

Hi,I would like to ask a question regarding the classification model.When I use a binary classification model in TMVA package to predict a new testing data.I could get the result that whether it is a signal data or background data. I wonder,when the testing data is predicted as a background data. whether I could simultaneously output the probability that the data is background.Thanks

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [July 24, 2021, 4:56pm UTC](https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965/2 "2021-07-24T16:56:11Z")

</div>

I’m afraid I don’t quite understand the question (perhaps @moneta does). Can you expand a bit or post illustrative code sample?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [August 3, 2021, 2:33pm UTC](https://root-forum.cern.ch/t/can-i-output-the-probability-in-a-classification-mission-using-a-binary-classification-model/45965/3 "2021-08-03T14:33:54Z")

</div>

Hello,  
I don’t also understand the question. A binary classification problem gives you a score result that you can interpret as a probability that the given event is signal or background.  
If your data has the label, so you know its truth class ID, you can then compute signal and background efficiencies (i.e compute what is normally called sensitivity and specificity)

Lorenzo
