-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with anomaly detection #938
Comments
Hi, I'm able to reproduce this issue. I see what you mean about the example using raw anomaly scores instead of the AnomalyLikelihood. |
So I took a look further into this issue... The python code for the AnomalyLikelihood class is a mess. I'm pretty sure there are a few bugs in there. Also, it contains a bunch of special cases for detecting anomalies in situations where HTM systematically fails to. So I rewrote the class to work much better. Its on a branch of this repo: |
Hi @zrosin |
@romanma9999 I don’t have the expertise to actually find the problem here. The predictions work correctly, so HTM under the hood is running correctly. The anomaly reporting is the only problem, whether this is from the c++ part of the implementation or the switch back to python I don’t know. I ran the program with NUPIC just to sanity check myself, and that worked, so I just switched to using that. If you are looking at trying to fix it, you may want to isolate the problem first, so make sure C++ is working before trying to change python side. |
I'm having trouble performing anomaly detection in python. I'm using the hotgym example and am struggling to detect anomalies. I posted on the htm forum earlier and think this is worthy of an issue here.
First I want to point out that the anomaly likelihood class isn't actually being used there, despite that it seems to be working correctly. It's already in the code, just never used. Anyways, I'm pretty sure I'm getting the expected results from the example, but I never was a fan of this dataset because the actual anomalies are hard to see.
In the forum post I mentioned above I get some useful advice on ways to try to debug this, The images and questions there may help with some context. but it seems to me that the tm.anomaly is not working correctly. Rather than increasing at anomalies, it decreases. Removing the date encoder does seem to fix this, but obviously removes the temporal context of the data, and is not a real solution. Here's hotgym running with the date encoding removed on a custom data set. It seems to catch the anomalies at 300 and 400, but the noise prevents 300 from being detected and delays 400 from being detected.
I wanted to compare this to NuPIC just to see if the results were actually correct and my understanding was wrong but it seems like NuPIC is working properly. Do note that the exact parameters are not exactly the same for the two runs, htm.core is running the hotgym.py parameters, but NuPIC is running these parameters.
I'm wondering if I'm doing something critically wrong or if there is an actual issue here. Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: