# PR curve in kibana from softmax

**URL:** <https://discuss.elastic.co/t/pr-curve-in-kibana-from-softmax/249646>\
**Category:** Kibana\
**Tags:** painless\
**Created:** [September 23, 2020, 11:07am UTC](https://discuss.elastic.co/t/pr-curve-in-kibana-from-softmax/249646 "2020-09-23T11:07:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doron\_Har\_Noy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doron_har_noy/32/48003_2.png) [@Doron\_Har\_Noy](https://discuss.elastic.co/u/Doron_Har_Noy)\
**Post date:** [September 23, 2020, 11:07am UTC](https://discuss.elastic.co/t/pr-curve-in-kibana-from-softmax/249646/1 "2020-09-23T11:07:39Z")

</div>

Hi all,  
I'm trying to create a pr curve or ROC curve from my data. ([https://en.wikipedia.org/wiki/Receiver\_operating\_characteristic](https://en.wikipedia.org/wiki/Receiver_operating_characteristic),  
[https://machinelearningmastery.com/roc-curves-and-precision-recall-curves-for-imbalanced-classification/](https://machinelearningmastery.com/roc-curves-and-precision-recall-curves-for-imbalanced-classification/)  
)

Each doc in my data have a softmax field ([0.8,0.2]) and a label (0), for example:

```auto
{
softmax: [0.8,0.2],
label: 0
...
}

```

I'm trying to do that by summing TF, TN, FP, FN from the data with scripted\_metric and having hard times working that with painless scripts.

Has anyone done something similar? I would love to get help with all the pain writing painless scripts.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 23, 2020, 10:39pm UTC](https://discuss.elastic.co/t/pr-curve-in-kibana-from-softmax/249646/2 "2020-09-23T22:39:16Z")

</div>

Welcome to our community! 😃

I am not a painless expert, but it might help someone else solve your issue if you can share what you have already tried?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 21, 2020, 10:39pm UTC](https://discuss.elastic.co/t/pr-curve-in-kibana-from-softmax/249646/3 "2020-10-21T22:39:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
