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

Fixed set_period() not updating decomposer parameters #3932

Merged
merged 4 commits into from
Jan 18, 2023

Conversation

christopherbunn
Copy link
Contributor

Also introduces a way to update parameters in a component.

Resolves #3771

@christopherbunn christopherbunn changed the title Fixed parameters not updating in decomposer dictionary Fixed parameters not updating in decomposer parameters dictionary Jan 17, 2023
@christopherbunn christopherbunn changed the title Fixed parameters not updating in decomposer parameters dictionary Fixed set_period not updating in decomposer parameters Jan 17, 2023
@christopherbunn christopherbunn changed the title Fixed set_period not updating in decomposer parameters Fixed set_period() not updating decomposer parameters Jan 17, 2023
@codecov
Copy link

codecov bot commented Jan 17, 2023

Codecov Report

Merging #3932 (8dde221) into main (16a1c86) will increase coverage by 0.1%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##            main   #3932     +/-   ##
=======================================
+ Coverage   99.7%   99.7%   +0.1%     
=======================================
  Files        346     346             
  Lines      36709   36727     +18     
=======================================
+ Hits       36576   36594     +18     
  Misses       133     133             
Impacted Files Coverage Δ
evalml/pipelines/components/component_base.py 100.0% <100.0%> (ø)
...omponents/transformers/preprocessing/decomposer.py 99.3% <100.0%> (ø)
...omponent_tests/decomposer_tests/test_decomposer.py 99.7% <100.0%> (+0.1%) ⬆️
evalml/tests/component_tests/test_components.py 99.0% <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.

LGTM but would be nice to have an explicit test for the decomposer.

@@ -205,7 +205,7 @@ def set_period(self, X: pd.DataFrame, y: pd.Series):

"""
self.period = self.determine_periodicity(X, y)
self.parameters.update({"period": self.period})
self.update_parameters({"period": self.period})
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 test verifying the period updates?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a line in test_decomposer.py::test_decomposer_set_period that's currently commented out testing this, you should be able to uncomment that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I uncommented that line, I think that should be sufficient? @jeremyliweishih I can also break it out into its own separate test if need be.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@christopherbunn thats great!

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.

Looks good! I agree with Jeremy about the testing. Have you verified if there's anywhere else we update parameters that could benefit from this function?

@@ -205,7 +205,7 @@ def set_period(self, X: pd.DataFrame, y: pd.Series):

"""
self.period = self.determine_periodicity(X, y)
self.parameters.update({"period": self.period})
self.update_parameters({"period": self.period})
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a line in test_decomposer.py::test_decomposer_set_period that's currently commented out testing this, you should be able to uncomment that!

@christopherbunn
Copy link
Contributor Author

christopherbunn commented Jan 18, 2023

@eccabay I did a quick ctrl+f search for places that update parameters and this should be it. I think this is the only place where we're updating the parameters from inside the component itself.

@christopherbunn christopherbunn enabled auto-merge (squash) January 18, 2023 18:03
@christopherbunn christopherbunn enabled auto-merge (squash) January 18, 2023 19:47
@christopherbunn christopherbunn merged commit 70ff947 into main Jan 18, 2023
@christopherbunn christopherbunn deleted the 3771_decomposer_dict branch January 18, 2023 19:58
@chukarsten chukarsten mentioned this pull request Jan 25, 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.

Decomposer does not update parameters dictionary when set_seasonal_period is called.
3 participants