Skip to content

Commit

Permalink
Remove parameters freq and dates from statsmodels-base models (#590)
Browse files Browse the repository at this point in the history
* remove freq and dates attributes

* lints

* update changelog

* lints

* return filterwarning to script

---------

Co-authored-by: Egor Baturin <[email protected]>
  • Loading branch information
egoriyaa and Egor Baturin authored Jan 31, 2025
1 parent 064b60f commit 8031c8c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 54 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed
- **Breaking:** Remove `FutureMixin`, `OutliersTransform.outliers_timestamps` and `OutliersTransform.original_values` ([#577](https://github.com/etna-team/etna/pull/577))
-
- **Breaking:** Remove parameters `freq` and `dates` from `SARIMAXModel` and `HoltWintersModel` ([#590](https://github.com/etna-team/etna/pull/590))
- **Breaking:** Remove `pytorch-forecasting` models and utilities (`DeepARModel`, `TFTModel` and `PytorchForecastingDatasetBuilder`) ([#578](https://github.com/etna-team/etna/pull/578))
-
-
Expand Down
25 changes: 0 additions & 25 deletions etna/models/holt_winters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import warnings
from datetime import datetime
from typing import Dict
from typing import List
from typing import Optional
Expand Down Expand Up @@ -47,8 +46,6 @@ def __init__(
initial_seasonal: Optional[Sequence[float]] = None,
use_boxcox: Union[bool, str, float] = False,
bounds: Optional[Dict[str, Tuple[float, float]]] = None,
dates: Optional[Sequence[datetime]] = None,
freq: Optional[str] = None,
missing: str = "none",
smoothing_level: Optional[float] = None,
smoothing_trend: Optional[float] = None,
Expand Down Expand Up @@ -152,12 +149,6 @@ def __init__(
for j=0,...,m-1 where m is the number of period in a full season.
Use None to indicate a non-binding constraint, e.g., (0, None)
constrains a parameter to be non-negative.
dates:
An array-like object of datetime objects. If a Pandas object is given
for endog, it is assumed to have a DateIndex.
freq:
The frequency of the time-series. A Pandas offset or 'B', 'D', 'W',
'M', 'A', or 'Q'. This is optional if dates are given.
missing:
Available options are 'none', 'drop', and 'raise'. If 'none', no nan
checking is done. If 'drop', any observations with nans are dropped.
Expand Down Expand Up @@ -187,8 +178,6 @@ def __init__(
self.initial_seasonal = initial_seasonal
self.use_boxcox = use_boxcox
self.bounds = bounds
self.dates = dates
self.freq = freq
self.missing = missing
self.smoothing_level = smoothing_level
self.smoothing_trend = smoothing_trend
Expand Down Expand Up @@ -251,8 +240,6 @@ def fit(self, df: pd.DataFrame, regressors: List[str]) -> "_HoltWintersAdapter":
initial_seasonal=self.initial_seasonal,
use_boxcox=self.use_boxcox,
bounds=self.bounds,
dates=self.dates,
freq=self.freq,
missing=self.missing,
)
self._result = self._model.fit(
Expand Down Expand Up @@ -495,8 +482,6 @@ def __init__(
initial_seasonal: Optional[Sequence[float]] = None,
use_boxcox: Union[bool, str, float] = False,
bounds: Optional[Dict[str, Tuple[float, float]]] = None,
dates: Optional[Sequence[datetime]] = None,
freq: Optional[str] = None,
missing: str = "none",
smoothing_level: Optional[float] = None,
smoothing_trend: Optional[float] = None,
Expand Down Expand Up @@ -600,12 +585,6 @@ def __init__(
for j=0,...,m-1 where m is the number of period in a full season.
Use None to indicate a non-binding constraint, e.g., (0, None)
constrains a parameter to be non-negative.
dates:
An array-like object of datetime objects. If a Pandas object is given
for endog, it is assumed to have a DateIndex.
freq:
The frequency of the time-series. A Pandas offset or 'B', 'D', 'W',
'M', 'A', or 'Q'. This is optional if dates are given.
missing:
Available options are 'none', 'drop', and 'raise'. If 'none', no nan
checking is done. If 'drop', any observations with nans are dropped.
Expand Down Expand Up @@ -635,8 +614,6 @@ def __init__(
self.initial_seasonal = initial_seasonal
self.use_boxcox = use_boxcox
self.bounds = bounds
self.dates = dates
self.freq = freq
self.missing = missing
self.smoothing_level = smoothing_level
self.smoothing_trend = smoothing_trend
Expand All @@ -655,8 +632,6 @@ def __init__(
initial_seasonal=self.initial_seasonal,
use_boxcox=self.use_boxcox,
bounds=self.bounds,
dates=self.dates,
freq=self.freq,
missing=self.missing,
smoothing_level=self.smoothing_level,
smoothing_trend=self.smoothing_trend,
Expand Down
25 changes: 0 additions & 25 deletions etna/models/sarimax.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import warnings
from abc import abstractmethod
from datetime import datetime
from typing import Any
from typing import Dict
from typing import List
Expand Down Expand Up @@ -456,8 +455,6 @@ def __init__(
concentrate_scale: bool = False,
trend_offset: float = 1,
use_exact_diffuse: bool = False,
dates: Optional[List[datetime]] = None,
freq: Optional[str] = None,
missing: str = "none",
validate_specification: bool = True,
fit_params: Optional[Dict[str, Any]] = None,
Expand Down Expand Up @@ -537,12 +534,6 @@ def __init__(
Whether or not to use exact diffuse initialization for non-stationary
states. Default is False (in which case approximate diffuse
initialization is used).
dates:
If no index is given by `endog` or `exog`, an array-like object of
datetime objects can be provided.
freq:
If no index is given by `endog` or `exog`, the frequency of the
time-series may be specified here as a Pandas offset or offset string.
missing:
Available options are 'none', 'drop', and 'raise'. If 'none', no nan
checking is done. If 'drop', any observations with nans are dropped.
Expand All @@ -568,8 +559,6 @@ def __init__(
self.concentrate_scale = concentrate_scale
self.trend_offset = trend_offset
self.use_exact_diffuse = use_exact_diffuse
self.dates = dates
self.freq = freq
self.missing = missing
self.validate_specification = validate_specification
self.fit_params = fit_params if fit_params else {}
Expand All @@ -595,8 +584,6 @@ def _get_fit_results(self, endog: pd.Series, exog: pd.DataFrame):
concentrate_scale=self.concentrate_scale,
trend_offset=self.trend_offset,
use_exact_diffuse=self.use_exact_diffuse,
dates=self.dates,
freq=self.freq,
missing=self.missing,
validate_specification=self.validate_specification,
**self.kwargs,
Expand Down Expand Up @@ -641,8 +628,6 @@ def __init__(
concentrate_scale: bool = False,
trend_offset: float = 1,
use_exact_diffuse: bool = False,
dates: Optional[List[datetime]] = None,
freq: Optional[str] = None,
missing: str = "none",
validate_specification: bool = True,
fit_params: Optional[Dict[str, Any]] = None,
Expand Down Expand Up @@ -722,12 +707,6 @@ def __init__(
Whether or not to use exact diffuse initialization for non-stationary
states. Default is False (in which case approximate diffuse
initialization is used).
dates:
If no index is given by `endog` or `exog`, an array-like object of
datetime objects can be provided.
freq:
If no index is given by `endog` or `exog`, the frequency of the
time-series may be specified here as a Pandas offset or offset string.
missing:
Available options are 'none', 'drop', and 'raise'. If 'none', no nan
checking is done. If 'drop', any observations with nans are dropped.
Expand All @@ -753,8 +732,6 @@ def __init__(
self.concentrate_scale = concentrate_scale
self.trend_offset = trend_offset
self.use_exact_diffuse = use_exact_diffuse
self.dates = dates
self.freq = freq
self.missing = missing
self.validate_specification = validate_specification
self.fit_params = fit_params if fit_params else {}
Expand All @@ -774,8 +751,6 @@ def __init__(
concentrate_scale=self.concentrate_scale,
trend_offset=self.trend_offset,
use_exact_diffuse=self.use_exact_diffuse,
dates=self.dates,
freq=self.freq,
missing=self.missing,
validate_specification=self.validate_specification,
fit_params=self.fit_params,
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,8 @@ filterwarnings = [
"ignore: The behavior of Timestamp.utcfromtimestamp is deprecated", # prophet
"ignore: Starting from v1.9.0, `tensorboardX` has been removed as a dependency",
"ignore: the `interpolation=` argument to percentile was renamed to `method=`", # pandas: old version uses deprecated numpy parameter
"ignore: Trying to infer the `batch_size` from an ambiguous collection", # pytorch_forecasting
"ignore: Implicitly cleaning up <TemporaryDirectory",
"ignore: Call to deprecated class DeepARModel.",
"ignore: dropout option adds dropout after all but last recurrent layer",
"ignore: Call to deprecated class TFTModel.",
"ignore: X does not have valid feature names, but IsolationForest was fitted with feature names" # fixed here https://github.com/scikit-learn/scikit-learn/issues/25844
]
markers = [
Expand Down

0 comments on commit 8031c8c

Please sign in to comment.