I’m looking for tuning my network to perform anomaly detection.
I’d like to have a feedback on the parameters I set to understand if I made errors.
An abstract of my dataset with computed anomaly score with the following network:
They are sensor readings so I have a read each 20ms.
While the parameters:
n = 64
w = 3
min = 0
max = 0
radius = 0
resolution = 0.1
periodic = FALSE
clip = null
forced = null
fieldType = float
encoderType = RandomDistributedScalarEncoder
Honestly I set just some of these parameters because I have no enough experience and knowledge for everyone so I set most following network examples or advise from documentation.
Can I have a feedback about the network set and if in your opinion the anomaly scores are plausible?
I tried to play a bit with parameters, especially with resolution, n and w ones. My goal is also to obtain prediction values together with anomaly scores.
Reading at htm post it seems that n should be 300-400 while w around 21.
Moreover, about resolution, focusing on my data probably a better choice would be 0.01 instead of 0.1.
So using those probably I fits better my dataset obtaining higher anomaly scores. I’ve also noticed that n = 400 make the algorithm a bit slow. Which are the criteria to choose n and w?
In order to obtain also predicted values I printed also:
but I obtain very strange values… sometimes null for example, sometimes already the same fixed value.
We talked about a lot of your questions in the latest Hackers’ Hangout:
Also, your model params look out of date (the
MAX_BOOST param is not
BOOST_STRENGTH). Use these model params as a starting point.
I’m watching the video. There is an explanation for the null value for the prediction? I modified the parameters with those described int your link but still appears a lot of null.
I’m not sure you’re getting predictions correctly. Have you walked through the Network API Quickstart?
I’m using essentially HTM.Java so I’m not referring to that document for implementation specifically.
I searched on forum and found this htm.java post which seems that the unique way to get predictions with java is the getMostProbableValue method.
Moved from #nupic into #htm-java.
For HTM.Java, disregard the parameter reference @rhyolight linked you to, and just use the parameters that are shown in the Parameters.java file. Refer to this Quick Start Guide instead.
To include prediction, make sure you have these set in your Parameters (where the Parameters variable name is “p”):
- p.set(KEY.AUTO_CLASSIFY, true);
- p.set(KEY.INFERRED_FIELDS, getInferredFieldsMap(“consumption”, CLAClassifier.class));
as of the newest version, you can specify what the fields are that you want to “predict” and what Classifier to use. Line #2 above refers to this feature.
getInferredFieldsMap() method is a convenience static method off of the
Thank you cogmission,
I re-set parameters looking at Parameters.Java file but now I obtain almost always 1.0 as anomaly score
About prediction, I’ve already set the parameters you said, but anyway
getMostProbableValue(1) sometimes returns me null value
Can you output Connections.printParameters() from your Network? Make sure
potentialRadius is set to your input width, if you’re using
global inhibition ?
Otherwise, at this point, I would say that it is a function of your parameters. You’ll have to experiment with those…
global inhibition was false, but anyway potentialRadius was equal to w.
Anyway as I said in another thread I’m investigating other parameters I found in the updated flink-htm I’m using.
Can you just confirm that to get predictions value the correct method to call is:
Yes definitely that’s the way it is retrieved.
You can verify this in a number of places in tests such as here.
By the way, you want global inhibition to be true for most cases (and it is much faster).
I’m experimenting with parameters but I believe I obtain really too much high anomaly scores.
I tried to submit my dataset to HTM studio and I obtained coherent results. I see HTM studio find automatically the best params for the data, is there a way in HTM.java to implement it or to get the parameters used by HTM studio?