Skip to content

christian-oleary/emmv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMMV

Maintenance Downloads Downloads Downloads

Implementation of EM/MV metrics based on N. Goix et al.

This is a means of evaluating anomaly detection models without anomaly labels

Installation

pip install emmv

Example Use

from emmv import emmv_scores

test_scores = emmv_scores(model, features)
  • Where 'model' is your trained scikit-learn, PyOD, or PyCaret model
  • Where 'features' is a 2D DataFrame of features (the X matrix)

Example resulting object:

{
    "em": 0.77586,
    "mv": 0.25367
}

If you are using models without a built-in decision_function (e.g. Keras or ADTK models), then you need to specify an anomaly scoring function. Please see examples in the examples folder.

Running Examples

Examples exist for ADTK, Alibi-Detect, PyCaret, PyOD, scikit-learn, and TensorFlow (Keras).

pip install .
python ./examples/sklearn_example.py

Interpreting scores

  • The best model should have the highest Excess Mass score
  • The best model should have the lowest Mass Volume score
  • Probably easiest to just use one of the metrics
  • Extreme values are possible

Contact

Please feel free to get in touch at christian.oleary@mtu.ie

Citation

Christian O'Leary. (2021–2022). EMMV library.

@Misc{emmv,
author = {Christian O'Leary},
title = {EMMV library},
howpublished = {\url{https://pypi.org/project/emmv/}},
year = {2021--2022}
}

About

Implementation of EM/MV metrics based on N. Goix et al.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages