8000 ValueError: Anom detection needs at least 2 periods worth of data · Issue #33 · zrnsm/pyculiarity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ValueError: Anom detection needs at least 2 periods worth of data #33
Open
@inder-preet-kakkar

Description

@inder-preet-kakkar

I was trying detect_ts with the following parameters;
max_anoms=0.1, direction='both', alpha=0.02, longterm=True

It seems to call detect_anoms with lesser data than required. Also my data is of 15 min resolution with
a daily seasonality (from Fourier Transform), this might have to do with the way you are assigning the period in your program.


ValueError Traceback (most recent call last)
in ()
6
7 results = detect_ts(pd.DataFrame({'time':full_data.index.values, 'values':full_data.metric_value.values}),
----> 8 max_anoms=0.1, direction='both', alpha=0.02, longterm=True)

c:\users\inder\desktop\sonalake\pyculiarity\pyculiarity\detect_ts.py in detect_ts(df, max_anoms, direction, alpha, only_last, threshold, e_value, longterm, piecewise_median_period_weeks, plot, y_log, xlabel, ylabel, title, verbose)
223 one_tail=anomaly_direction.one_tail,
224 upper_tail=anomaly_direction.upper_tail,
--> 225 verbose=verbose)
226
227 # store decomposed components in local variable and overwrite

c:\users\inder\desktop\sonalake\pyculiarity\pyculiarity\detect_anoms.py in detect_anoms(data, k, alpha, num_obs_per_period, use_decomp, one_tail, upper_tail, verbose)
39 # Check to make sure we have at least two periods worth of data for anomaly context
40 if num_obs < num_obs_per_period * 2:
---> 41 raise ValueError("Anom detection needs at least 2 periods worth of data")
42
43 # Check if our timestamps are posix

ValueError: Anom detection needs at least 2 periods worth of data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0