cossio / ROCCurves.jl

MIT License
7 stars 0 forks source link

Computation of auc seems wrong #2

Closed chrisn-pik closed 1 year ago

chrisn-pik commented 1 year ago

Maybe I am using it wrong, but the auc results differ from MultivariateAnomalies.auc and sklearn (python)

using ROCCurves, MultivariateAnomalies
ŷ = [0, 1, 1, 1, 1, 0, 1 ,0 ,1]
y = [0, 1, 1, 1, 1, 0, 0 ,0 ,1]
roccurves_auc = ROCCurves.auc(ŷ,y)
ma_roc = MultivariateAnomalies.auc(ŷ,y)

where y is the ground truth and ŷ the prediction.

roccurves_auc = 0.95 and ma_roc = 0.875

Using python, I have the following:

from sklearn.metrics import roc_auc_score
ŷ = [0, 1, 1, 1, 1, 0, 1 ,0 ,1]
y = [0, 1, 1, 1, 1, 0, 0 ,0 ,1]
roc_auc_score(y, ŷ)
0.875

Am I doing something wrong or is there an error in the computation?