Preface: Since I’m a new user I’m not allowed to post multiple images. They are all in this gallery, and I will say the name of the image when it should be referenced in the gallery. Album — Postimages
Hello, I’m new to working with HTM. I’m trying to use it for anomaly detection and have run into a problem. I’m using htm.core and the tm.anomaly function isn’t triggering an anomaly when it should be. I’m using a slightly modified version of the hotgym.py example. My results from this dataset seem to match what I’ve seen from other people running the code.
I believe my confusion mostly lies around the anomaly likelihood class. I believe this is pretty critical to what I want to do based on reading other forum posts and watching matts video on hotgym with NuPIC (About Anomaly Detection Thresholding). Am I correct in thinking that the anomaly likelihood class in htm.core is not functioning properly? I think I read this somewhere but I am not sure. I may be using it wrong or have poor parameters.
Here is me running hotgym, using the same parameters as the original, but also plotting anomaly likelihood:
Here is a zoomed in version of the image above. It shows correct prediction, but fails to detect the anomaly where power usage doesn’t go back to the same base level at ~320:
At first I wondered if the weird weekly spikes was throwing it off. I found increasing the encoder size for the timeOfDay parameter from 30 to 100 removed this anomaly spiking. I assume it just wasn’t large enough for the temporal memory algorithm to remember it well enough with only 30, but I really don’t know why this worked. Here is the two same images from before with new param to show that prediction still works, but anomaly stays glued to 0 and anomaly likelihood stays glued to 1:
I also tried this against a dataset from NAB with an artificial anomaly and did not catch it:
Is my problem just that htm.core doesn’t fully implement anomaly detection. If so I can change to NuPIC, I just didn’t want to deal with python 2 mostly. In case its poor parameters, here is my full parameter list. My htm code is the same as the example from htm.core/py/htm/examples/hotgym.py. My full parameter list is
enc: time: timeOfDayVar1: 100 timeOfDayVar2: 1 weekend: 21 value: resolution: 0.88 size: 1000 sparsity: 0.02 predictor: sdrc_alpha: 0.1 anomaly: likelihood: probationaryPct: 0.1 reestimationPeriod: 100 sp: boostStrength: 3.0 columnCount: 1638 globalInhibition: True localAreaDensity: 0.04395604395604396 potentialPct: 0.85 synPermActiveInc: 0.04 synPermConnected: 0.13999999999999999 synPermInactiveDec: 0.006 wrapAround: True tm: activationThreshold: 17 cellsPerColumn: 13 initialPerm: 0.21 maxSegmentsPerCell: 128 maxSynapsesPerSegment: 64 minThreshold: 10 newSynapseCount: 32 permanenceDec: 0.1 permanenceInc: 0.1 predictedSegmentDecrement: 0.0