pyculiarity
pyculiarity copied to clipboard
ValueError: Anom detection needs at least 2 periods worth of data
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)
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
just give more data, and retry