Skip to content

Integrate automatic period determination into AutoMLSearch#3952

Merged
eccabay merged 20 commits into
mainfrom
5692_period_in_automl
Feb 14, 2023
Merged

Integrate automatic period determination into AutoMLSearch#3952
eccabay merged 20 commits into
mainfrom
5692_period_in_automl

Conversation

@eccabay

@eccabay eccabay commented Jan 23, 2023

Copy link
Copy Markdown
Contributor

Resolves #3985

@codecov

codecov Bot commented Jan 23, 2023

Copy link
Copy Markdown

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.

@eccabay eccabay marked this pull request as ready for review January 27, 2023 15:56

@jeremyliweishih jeremyliweishih left a comment

Copy link
Copy Markdown
Collaborator

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 😄

Comment thread evalml/pipelines/utils.py Outdated
# 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

@christopherbunn christopherbunn left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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?

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@chukarsten chukarsten left a comment

Copy link
Copy Markdown
Contributor

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