Supervised multivarient Anomaly Detaction by using HTM

Hi, I am new to HTM and start learning HTM, I have a multivariant labeled dataset and want to apply HTM by using SP, TM. I saw many examples like HOTGYM.py, but I didn’t find any example which can help for multivariant supervised anomaly detection.

I need help to design an HTM model for my dataset and find an F1-score.

(Note: In hotgym.py the tm.anomaly function returns anomaly score in floating-point 0 to 1. How can I get an anomaly score in the form of binary?, I already applied threshold function. but it gives bad results)
Snippet of data
Quick reply will be higly apprciated
image

The HotGym data set is technically multivariate, if you include the datetime encoder. This is all set in the model params, in the “encoders” dict. That’s where you’ll see “consumption” with a ScalarEncoder, along with “timestamp_timeOfDay” with a DateEncoder. To add more metric fields like “consumption” just add another sub-dictionary within “encoders”.

This is what the Anomaly Likelihood is for. It’s a post processing that look for shifts in the distribution of anomaly scores. This value is what is recommended to threshold, not the raw anomaly score.

I’d highly recommend looking into NAB (Numenta Anomaly Benchmark). It’s sort of like an F1 score but designed for real time anomaly detection, rewarding early detection and punishing false positives based on labeled ground-truth anomalies. Numenta applied this scoring system to a bunch of algorithms on like 60 datasets, so its well tested and the code is also open source.

Thanks for reply. I will check and update about my experiments.

1 Like