Open triciascully opened 5 years ago
So I went into the function code and added * in front of args and * in front of kwargs, which fixed it (I saw that you took those s away earlier this year in an update @hokiegeek2?), but now I've got new issues that I can't debug, and I'm wondering if it's maybe a version issue with my systems and your code, or if there's a bug or something in both the anomaly_detection_ts() and the anomaly_detection_vec() code.
For more context, this is what my data looks like:
test.head()
Out[241]: timeblock 2018-08-13 00:00:00 10.607767 2018-08-13 00:15:00 11.221798 2018-08-13 00:30:00 11.112807 2018-08-13 00:45:00 10.220628 2018-08-13 01:00:00 12.900123 dtype: float64
There are 2783 records, and each at 15 min. intervals apart (the example data is minute-level, so it's a little different, and I changed the hard-coded min. period setting from 1440 to 96 manually in the ts code).
When I run it, it only spits out 3 records from the 2783 that it would call "outliers":
anomaly_detect_ts(test, max_anoms=0.04,direction="both") {'anoms': 2018-08-15 11:45:00 31.482831 2018-08-17 13:30:00 25.210884 2018-08-15 09:15:00 4.685535 dtype: float64, 'expected': None, 'plot': None}
I honestly believe it should be picking up a lot more than 3 outliers in this full dataset, based on some plots, but also, note that I didn't use plot=TRUE in the code -- it throws the error " NameError: name 'TRUE' is not defined". I tried different iterations of how to write true ("TRUE","True",True) and plot =True worked, but then I got a different error: " UnboundLocalError: local variable 'num_days_per_line' referenced before assignment"
I was going into a rabbit hole of errors at that point, so I decided to back out and just work with the output for the time being.
When I take that same Series and run it through the anomaly_detection_vec() function, I get the following error:
KeyError Traceback (most recent call last)
@triciascully I am working these and a couple of issues I encountered when working with anomaly_detect_vec. I plan to getting these wrapped up and a patch submitted soon.
@triciascully @Marcnuth Okay, fixed the following:
Just submitted pull request
@triciascully this is implemented and tested in the master branch of my fork
merged, thanks @Marcnuth
@triciascully please close this, thanks
Hi there -
When running:
anomaly_detect_vec(data, max_anoms=0.02, period=96, direction="both", plot=True)
I keep getting this:
TypeError: __verbose_if() missing 1 required positional argument: 'kwargs'
I changed the assert validation from
to
because I kept getting an error that the isinstance() needed 2 arguments, and now I'm getting the __verbose error.
I have a feeling this might be a Python 2 vs. Python 3 issue but I'm not familiar with python enough to really know, and I think continuing on and trying to debug every new issue that pops up will not end up working... any suggestions/easily-identifiable-fixes you can see?