PR curve in kibana from softmax

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://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:

{
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.

Welcome to our community! :smiley:

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