Integrate automatic period determination into AutoMLSearch#3952
Conversation
Codecov Report
@@ 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
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
jeremyliweishih
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
can you add a comment why we use 0.99 and 1.01? Looks somewhat arbitrary unless you have the context!
There was a problem hiding this comment.
I'm assuming there's a margin of error with the period determination that this test accounts for?
christopherbunn
left a comment
There was a problem hiding this comment.
LGTM once Jeremy's comments are addressed as well!
| "BAS", | ||
| "BH", | ||
| ] | ||
| invalid_frequencies = [] |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
chukarsten
left a comment
There was a problem hiding this comment.
Looks good! Well done. Nice type hinting!
Resolves #3985