Add Exponential Smoothing time series estimator#3157
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3157 +/- ##
=======================================
+ Coverage 99.7% 99.7% +0.1%
=======================================
Files 324 326 +2
Lines 31302 31432 +130
=======================================
+ Hits 31198 31328 +130
Misses 104 104
Continue to review full report at Codecov.
|
| random_seed=random_seed, | ||
| ) | ||
|
|
||
| def _remove_datetime(self, data, features=False): |
There was a problem hiding this comment.
Nit: Since _remove_datetime, _match_indices, and _set_forecast don't rely on the class instance and are shared by ARIMARegressor (and potentially future similar estimators), you can move these to pipelines/components/utils. Not necessary for this PR and we can file a separate issue for code cleanup if necessary.
evalml/tests/component_tests/test_exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
bchen1116
left a comment
There was a problem hiding this comment.
Great work here so far! There's some errors in the docstrings, and I believe a test should be fixed/updated for better coverage, but it's looking good!
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Show resolved
Hide resolved
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Show resolved
Hide resolved
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
bchen1116
left a comment
There was a problem hiding this comment.
Left some comments, but exciting to be able to add this in soon!
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Show resolved
Hide resolved
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
evalml/tests/component_tests/test_exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
bchen1116
left a comment
There was a problem hiding this comment.
Thanks for making the changes! This looks great to me. Left one testing change suggestion, but not blocking!
freddyaboulton
left a comment
There was a problem hiding this comment.
@eccabay Implementation looks good to me! Thanks for making the changes. Waiting on the latest batch of perf tests.
evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py
Outdated
Show resolved
Hide resolved
| trend=None, | ||
| damped_trend=False, | ||
| seasonal=None, | ||
| sp=2, |
There was a problem hiding this comment.
Given that the default value of seasonal is None, shouldn't the default value of sp be None too? Is sp used only if seasonal is not None?
There was a problem hiding this comment.
I would have thought so as well, but there's something in the sktime implementation that enforces otherwise. I can't tell exactly where sp is used when seasonal is None, but it fails otherwise.
chukarsten
left a comment
There was a problem hiding this comment.
A few nits and questions, but nothing blocking. Looks great! Good work!
| return data_no_dt | ||
|
|
||
| def _set_forecast(self, X): | ||
| from sktime.forecasting.base import ForecastingHorizon |
There was a problem hiding this comment.
Are we importing here to allow the import_or_raise to go first?
| clf.fit(X=X) | ||
|
|
||
|
|
||
| @pytest.fixture |
There was a problem hiding this comment.
Very nice, love this fixture reusage and combination.
| assert not isinstance(y_train_removed.index, pd.DatetimeIndex) | ||
|
|
||
|
|
||
| def test_set_forecast(get_ts_X_y): |
There was a problem hiding this comment.
It seems kind of weird to be testing what's going on purely internally to the regressor!
| clf = ExponentialSmoothingRegressor() | ||
| with patch.object(clf, "_component_obj"): | ||
| clf.fit(X, y) | ||
| assert clf.feature_importance == np.zeros(1) |
There was a problem hiding this comment.
Filing this to standardize the way we handle these not-supported feature importance tests.
Closes #2991. This will add the estimator to AutoML, as per the current perf test results.