2

I am currently working in anomaly detection algorithms. I read papers comparing unsupervised anomaly algorithms based on AUC values. For example i have anomaly scores and anomaly classes from Elliptic Envelope and Isolation Forest. How can i compare these two algorithms based on AUC values.

I am looking for a python code example.

Thanks

SeckinDinc
  • 51
  • 3

2 Answers2

2

Problem solved. Steps i done so far;

1) Gathering class and score after anomaly function 2) Converting anomaly score to 0 - 100 scale for better compare with different algorihtms 3) Auc requires this variables to be arrays. My mistake was to use them like Data Frame column which returns "nan" all the time.

Python Script:

#outlier_class and outlier_score must be array
fpr,tpr,thresholds_sorted=metrics.roc_curve(outlier_class,outlier_score)
aucvalue_sorted=metrics.auc(fpr,tpr)
aucvalue_sorted

Regards,

Seçkin Dinç

SeckinDinc
  • 51
  • 3
0

Although you already solved your problem, my 2 cents :)

Once you've decided which algorithmic method to use to compare them (your "evaluation protocol", so to say), then you might be interested in ways to run your challengers on actual datasets.

This tutorial explains how to do it, based on an example (comparing polynomial fitting algorithms on several datasets).

(I'm the author, feel free to provide feedback on the github page!)

smarie
  • 4,568
  • 24
  • 39