I want to detect anomalies with HTM

I want to detect anomalies with HTM.
What should be set to the inferenceType of search_def.json to generate model_params.py to detect anomalies?
I tried to write Anomaly but it was not generated.
All values ​​that can be set when reading the Swarm document are separate arguments, so it is written that it is beyond the scope of this document.
I tried searching by search searching on Quick Search on the document page with search_def.json, but only the page of the same Swarm was searched

Have you watched this? It is still relevant, although the APIs have changed just a bit since NuPIC 1.0.

I am Japanese and do not speak English as my mother tongue so I can not understand even if I showed English video.
Please explain.

First, read the one gym prediction README. Then read the one gym anomaly README.

Yes I read all of README.
The prediction was completely done with.
Next, when I read the README for anomaly detection, it was written that it was just changing the inferenceType of model_paramas.py to Temporary Anomaly, so I tried it as expected, but the result was useless.
So I thought that I had to swarm by changing the inferenceType of search_def.json to Anomaly, but this time Swarm did not work well.
Where is it wrong?

Swarming shouldn’t actually be necessary for anomaly detection. If you use the run.py file within ‘…/opf/clients/hotgym/anomaly’ you shouldn’t need to run swarm at all because there are already parameters there. All you should have to do is:

  1. Set the ‘GYM_NAME’ equal to the name of the data file
  2. Set the ‘DATA_DIR’ equal to the directory where your data file is stored
  3. Set the ‘predictedField’ equal to the name of the variable you’re getting predictions for
  4. Make sure there is a file within the the model_params folder called GYM_NAME_model_params.py (where GYM NAME is the name of your data file
  5. Make sure that you in that model_params.py file have encoders for all variables involved.
1 Like

I do not understand well, but are not we going to do anomaly detection with a program listed at http://nupic.docs.numenta.org/1.0.1/quick-start/algorithms.html?

You can yes, though I think it is easier to download nupic (pip install nupic). Then once you have it go to this folder: ‘/nupic/examples/opf/clients/hotgym/anomaly/one_gym’. From there open the ‘run.py’ file and follow the steps I listed above. This should be easier. Also I know this is all difficult being new to English, but I think you should still watch that tutorial video @rhyolight suggested. Even if you don’t understand what he says you could still follow visually, imitate all of his commands as he types them.

I saw the video and did it as instructed, but nupic_anomaly_output.py can not be done anywhere.
In video it is supposed to be under your home, but it is not made.
What should I do?

It is in the repo right here:

I’m not sure why the translation of google translation is strange and I do not understand well. numenta / nupic / blob / master / examples / opf / clients / hotgym / anomaly / one_gym / nupic_anomaly_output.py
Do you mean that we need to copy?

According to the description of the video something like nupic_anomaly_output.py exists under my home directory, but actually it did not exist.

I don’t understand. The file exists exactly where it should be in the repository.

Yes. It is confirmed that it exists in the repository.
But from the description of the video I understood that run.py will generate nupic_anomaly_output.py in my home directory.
Is it different?
Can I copy nupic_anomaly_output.py from my repository into my home directory?

No, that is not true. That script is never generated. I don’t know why you would need this script in your home directory.

Yes. Since it explains that the description of the video is to edit nupic_anomaly_output.py under the home directory, executing run.py clarified in the sandbox under the home directory clearly generates nupic_anomaly_output.py under the home directory Because I understood that.
I understand that it will not be generated automatically.
Thank you very much.

I Think you misunderstand. At the begining in the video, he just copies the github directiry to home directory.

Sorry, it has been a long time since I created these tutorials. Did you get it working?

Yes. That’s right.
I overlooked what to copy.
I’m sorry.

1 Like