Anomaly detection for multi features


According to the examples I founded in the site ,I see the number of predict attribute that was predicted for detected anomaly was 1.

> model.enableInference({'predictedField': 'consumption'})

I have three questions ,

  1. If I want to predict more than one attribute , can I do that with NuPIC (for anomaly detection purpose)?
  2. What is the recommended number of features that I can predict as ratio to the number of input features ? , can I predicate the all input features ? , or may that will decries the accuracy of the
    prediction ?
  3. If the answers to the first question is Yes!,How I tell to to the model to predict more than one feature model.enableInference({'predictedField': 'consumption'})?


Not being familiar with the full NuPIC reagons API. Just some experiences with HTM overall.

Yes, just use the MutiEncoder to encode all your data into one SDR.

Around 5~6 features are generally the maximum amount you can work with. And sort of yes, the more feature, the less accurate the predictions become (more possible corrilations)

A MultiEncoder!



Ok, thanks for your answers.
So it’s mean in the predict I need to define?

model.enableInference({'predictedField': '**my_multiEncoderField**'}

Another question, you write that the maximum number of predict features are 5-6.
Your recommendation is depending on the number of representing bits (n) of that features in the SP? For example if I have 10 parameters that share the 2048 bit span, and I try to predict part of them or all of them why this is changing the accuracy of the predict?
In addition in others multi features predict technic (like LSTM,CNN), if I have allot of features that I want to predict, with copmlex infrastructure I add more layers to my model, there’s something similar in the NuPIC, that give the ability to representing more complex infrastructure.



Thanks for your interest in HTM and asking on the forum.

I’m not very familiar with the reasons API. But I do think that is the way to go. Maybe another forum member can help.

You predict all of them. A standard HTM network is composed with 2 layers. A SP, which reduces noise and unneeded information. And a TM, which predicts the next time step. Given a predicted SDR, you can ask SP to walk back it’s synapses to reconstruct the input field.

Unfortunately staking layers in NuPIC although is doable, it will not give you any extra performance in standard HTM. I (and other community members) am working on an implementation of the thousand brains theory which will allow multiple cortical columns to work together. But unlike staking CNN layers and extracting higher and higher level features, it utilizes multiple cortical columns to predicting simultaneously.



Hi @MAK thanks for joining the forum.

Unfortunately not.






Hii @rhyolight thaks for your answers.
But if I am working with algorithm API like @marty1885 recommended, with multi-encoder for encoding multi features, why I can’t use the anomaly detector mechanism directly? Or even implement it according to document

I try to understand the limitations of the existing HTM framework,
can I predict or recognize anomaly in case that I have more than one feature? (by Algorithm API) , in case that I want to predict more than 1 attribute ,may I can do that with setting all the features I want to predict in one multi encoder, and set this feature as predict feature ?




Since you asked: If I want to predict more than one attribute. I think rhyolight (aka Matt) is referring to reconstructing all bits of the input filed and convert them back into real values. Which is in fact nearly impossible. But sure, you can use the anomaly detector with multiple input features. That is doable and a quite useful feature of HTM.



Yes you are able to implement these things yourself. And please do! and share with us when you are done :smiley:

Yes you can. The anomaly indication takes into account all encoded features. You can do this through the Network API or use the OPF with a TemporalAnomaly model as shown in the hot gym anomaly params. You can add more fields and encodings to this model and as long as you adjust your model params in the SP appropriately (the number of encoded bits must match the SP’s input size) it should work.



It is possible, and there is even an issue describing it. But decoders are required for this, so it would only work with simple scalar numbers today.