Skip to content

Commit

Permalink
reset condition for period
Browse files Browse the repository at this point in the history
  • Loading branch information
remyogasawara committed Aug 2, 2023
1 parent 781c139 commit 4a8cc0f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def fit(self, X: pd.DataFrame, y: pd.Series = None) -> STLDecomposer:
# Save the frequency of the fitted series for checking against transform data.
self.frequency = series_y.index.freqstr or pd.infer_freq(series_y.index)
# Determine the period of the seasonal component
self.set_period(series_X, series_y)
if self.is_multiseries or self.period is None:
self.set_period(series_X, series_y)

stl = STL(series_y, seasonal=self.seasonal_smoother, period=self.period)
res = stl.fit()
Expand All @@ -220,7 +221,7 @@ def fit(self, X: pd.DataFrame, y: pd.Series = None) -> STLDecomposer:
"seasonal": self.seasonal,
"seasonality": self.seasonality,
"trend": self.trend,
"residual": self.resid,
"residual": self.residual,
"period": self.period,
}

Expand Down

0 comments on commit 4a8cc0f

Please sign in to comment.