Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STL Decomposer #3741

Merged
merged 70 commits into from
Oct 25, 2022
Merged

STL Decomposer #3741

merged 70 commits into from
Oct 25, 2022

Conversation

chukarsten
Copy link
Contributor

Decompose things...STL'ly!

@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #3741 (061f02e) into main (e7c35a5) will decrease coverage by 0.1%.
The diff coverage is 99.9%.

@@           Coverage Diff           @@
##            main   #3741     +/-   ##
=======================================
- Coverage   99.7%   99.7%   -0.0%     
=======================================
  Files        341     343      +2     
  Lines      35287   35681    +394     
=======================================
+ Hits       35155   35545    +390     
- Misses       132     136      +4     
Impacted Files Coverage Δ
evalml/pipelines/components/__init__.py 100.0% <ø> (ø)
...alml/pipelines/components/transformers/__init__.py 100.0% <ø> (ø)
...sts/decomposer_tests/test_polynomial_decomposer.py 100.0% <ø> (ø)
evalml/tests/component_tests/test_utils.py 99.1% <ø> (ø)
...omponent_tests/decomposer_tests/test_decomposer.py 99.5% <99.5%> (-0.5%) ⬇️
.../components/transformers/preprocessing/__init__.py 100.0% <100.0%> (ø)
...omponents/transformers/preprocessing/decomposer.py 99.3% <100.0%> (-0.7%) ⬇️
...ransformers/preprocessing/polynomial_decomposer.py 100.0% <100.0%> (ø)
...nents/transformers/preprocessing/stl_decomposer.py 100.0% <100.0%> (ø)
...nent_tests/decomposer_tests/test_stl_decomposer.py 100.0% <100.0%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

chukarsten and others added 25 commits October 11, 2022 10:42
…different classes. Moved the test to project the seasonal signal up to the parent Decomposer class. Moved the testing for the seasonal projection to the decomposer test module.
… to move that up to the base Decomposer class.
* Updated get_trend_df() to work out of sample.

* Fixed transform() to work with in sample, but not spanning the sample.

* Fixed inverse_transform to work with smaller than sample, in sample data.
…ple. Also updated test for transform to return same if y is None and moved that to parent class.
…etter reflect what's going on. Docstring changes.
…e seasonal sample to match the STLDecomposer.
Copy link
Contributor

@eccabay eccabay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic 🚢 What beasts of tests these are.

Comment on lines +340 to +341
if not isinstance(X.index, pd.DatetimeIndex):
raise TypeError("Provided X should have datetimes in the index.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to continue enforcing this? We can set it within this function relatively easily.

dec.set_seasonal_period(X, y)

assert 0.95 * period <= dec.seasonal_period <= 1.05 * period
assert dec.parameters["seasonal_period"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this purposely just checking that the parameter exists? Should we be checking its value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, yes, this one is a bug. For some reason, parameters dict value is not being set. I tried fixing it, but for some reason cannot get it to set. I filed this to look at it later given that we don't even use set_seasonal_period.

assert stl.seasonal_period == 5


def build_test_target(subset_y, seasonal_period, transformer_fit_on_data, to_test):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth it to move to conftest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is! This is actually handled in this parity PR and will shift up to the test_decomposer.py class.

Copy link
Collaborator

@jeremyliweishih jeremyliweishih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - amazing effort!

@ParthivNaresh
Copy link
Contributor

I got the chance to play around with it and I think it looks and works great, fantastic job!

@chukarsten
Copy link
Contributor Author

praise god

@chukarsten chukarsten merged commit fa71b7b into main Oct 25, 2022
@chukarsten chukarsten deleted the stl_decomposer branch October 25, 2022 15:26
@chukarsten chukarsten mentioned this pull request Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants