Bug in timeseries_anomalies function called regression_errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- machine-learning
Research direction
Start in analysis/timeseries_anomalies.py at the regression_errors call to pandas ewm, then reproduce the failure with the NASA Telemanom T-10 split described here. Verify that the smoothing span remains valid for the 24-sample test set and that the pipeline completes without the reported ValueError.
Written by the indexing model from the issue text.
Description
What I Did
I ran a pipeline with signal T-10 from the publicly available NASA Telemanom signal. My train/test split was 571 training samples and 24 testing samples. The code seems to be breaking because the span in ewm is int(len(y)*smoothing_window) = int(24*0.01) = int(0.24) = 0 which is less than 1. As per the pandas documentation span >= 1 (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.ewm.html)
One way to fix this is to add a max(1, int(len(y)*smoothing_window)) so that we never go below 1 for the span.
Traceback:
Traceback (most recent call last):
File "run_pipelines.py", line 76, in <module>
anoms = pipeline.predict(test)
File "/home/itinawi/meng/venv/lib/python3.5/site-packages/mlblocks/mlpipeline.py", line 264, in predict
outputs = block.produce(**produce_args)
File "/home/itinawi/meng/venv/lib/python3.5/site-packages/mlblocks/mlblock.py", line 268, in produce
return self.primitive(**produce_args)
File "/home/itinawi/meng/IML-private/Orion/analysis/timeseries_anomalies.py", line 33, in regression_errors
return pd.Series(errors).ewm(span=smoothing_window).mean().values
File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/generic.py", line 8927, in ewm
adjust=adjust, ignore_na=ignore_na, axis=axis)
File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/window.py", line 2489, in ewm
return EWM(obj, **kwds)
File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/window.py", line 2074, in __init__
self.com = _get_center_of_mass(com, span, halflife, alpha)
File "/home/itinawi/meng/venv/lib/python3.5/site-packages/pandas/core/window.py", line 2389, in _get_center_of_mass
raise ValueError("span must satisfy: span >= 1")
ValueError: span must satisfy: span >= 1
- Dominant language
- Python
- Stars
- 70
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MLBazaar/MLPrimitives
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
MLBazaar/MLPrimitives#274 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
MLBazaar/MLPrimitives#270 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
MLBazaar/MLPrimitives#269 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
MLBazaar/MLPrimitives#268 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 50/100
MLBazaar/MLPrimitives#260 ·
All issues in MLBazaar/MLPrimitives
Similar issues
-
namespace operations
Difficulty 1/5 Under an hour Newbie friendliness 72/100
EclipseFdn/open-vsx.org#13737 ·
Maintainers usually reply within 1 day
-
Zero-token evaluations are treated as missing cost in selectionPossibly taken @sylvesterkaczmarek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google-research/rrsi#6 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws-samples/sample-aws-genai-db-modernizer#294 ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
githubnext/gh-aw-workshop#4174 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WingedGuardian/GENesis-AGI#2852 ·
Maintainers usually reply within 1 day