File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -305,6 +305,7 @@ def detect_anomalies(
305305 Args:
306306 df (pd.DataFrame):
307307 DataFrame containing the time series to detect anomalies.
308+ Minimum series length is 1 higher for Prophet than other models.
308309 h (int, optional):
309310 Forecast horizon specifying how many future steps to predict.
310311 In each cross validation window. If not provided, the seasonality
@@ -357,9 +358,11 @@ def detect_anomalies(
357358 else :
358359 _n_windows = min (n_windows , max_possible_windows )
359360 if _n_windows < 1 :
361+ # min series length should be 1 higher for Prophet than other models
362+ exp_min_series_length = h + 1 if isinstance (self , ProphetBase ) else h + 2
360363 raise ValueError (
361364 f"Cannot perform anomaly detection: series too short. "
362- f"Minimum series length required: { h + 1 } , "
365+ f"Minimum series length required: { exp_min_series_length } , "
363366 f"actual minimum length: { min_series_length } "
364367 )
365368 cv_results = self .cross_validation (
You can’t perform that action at this time.
0 commit comments