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

Integrate automatic period determination into AutoMLSearch #3952

Merged
merged 20 commits into from
Feb 14, 2023

Conversation

eccabay
Copy link
Contributor

@eccabay eccabay commented Jan 23, 2023

Resolves #3985

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Merging #3952 (ce95240) into main (78bd72f) will increase coverage by 0.1%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##            main   #3952     +/-   ##
=======================================
+ Coverage   99.7%   99.7%   +0.1%     
=======================================
  Files        347     347             
  Lines      36906   36914      +8     
=======================================
+ Hits       36785   36793      +8     
  Misses       121     121             
Impacted Files Coverage Δ
...sts/decomposer_tests/test_polynomial_decomposer.py 100.0% <ø> (ø)
...omponents/transformers/preprocessing/decomposer.py 100.0% <100.0%> (ø)
...nents/transformers/preprocessing/stl_decomposer.py 100.0% <100.0%> (ø)
evalml/pipelines/utils.py 99.6% <100.0%> (+0.1%) ⬆️
...nent_tests/decomposer_tests/test_stl_decomposer.py 100.0% <100.0%> (ø)
evalml/tests/pipeline_tests/test_pipeline_utils.py 99.8% <100.0%> (+0.1%) ⬆️

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

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.

Great work! Just some nits 😄

# Make sure there's a seasonal period
order = 3 if "Q" in freq else 5
temp_decomp = STLDecomposer(time_index, rel_max_order=order)
seasonal_period = temp_decomp.determine_periodicity(X, y)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we're utilizing determine_periodicity like this - maybe it should be a class method?


stl = STLDecomposer()
stl.fit(X, y)
assert period * 0.99 <= stl.period <= period * 1.01
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you add a comment why we use 0.99 and 1.01? Looks somewhat arbitrary unless you have the context!

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming there's a margin of error with the period determination that this test accounts for?

Copy link
Contributor

@christopherbunn christopherbunn left a comment

Choose a reason for hiding this comment

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

LGTM once Jeremy's comments are addressed as well!

"BAS",
"BH",
]
invalid_frequencies = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we delete this line entirely if there are no invalid frequencies?


stl = STLDecomposer()
stl.fit(X, y)
assert period * 0.99 <= stl.period <= period * 1.01
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming there's a margin of error with the period determination that this test accounts for?

)
def test_unsupported_frequencies(
bad_frequency,
generate_seasonal_data,
):
"""This test exists to highlight that the underlying statsmodels STL component won't work for minute or annual frequencies."""
"""This test exists to highlight that even though the underlying statsmodels STL component won't work
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@chukarsten chukarsten left a comment

Choose a reason for hiding this comment

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

Looks good! Well done. Nice type hinting!

@eccabay eccabay merged commit 511eac5 into main Feb 14, 2023
@eccabay eccabay deleted the 5692_period_in_automl branch February 14, 2023 22:10
@christopherbunn christopherbunn mentioned this pull request Feb 15, 2023
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.

Integrate Automatic Periodicity Determination into EvalML
4 participants