Skip to content

Fixed set_period() not updating decomposer parameters#3932

Merged
christopherbunn merged 4 commits into
mainfrom
3771_decomposer_dict
Jan 18, 2023
Merged

Fixed set_period() not updating decomposer parameters#3932
christopherbunn merged 4 commits into
mainfrom
3771_decomposer_dict

Conversation

@christopherbunn

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

codecov Bot commented Jan 17, 2023

Copy link
Copy Markdown

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.

@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.

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

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

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 test verifying the period updates?

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.

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

Choose a reason for hiding this comment

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

@christopherbunn thats great!

@eccabay eccabay 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! I agree with Jeremy about the testing. Have you verified if there's anywhere else we update parameters that could benefit from this function?

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

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.

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

christopherbunn commented Jan 18, 2023

Copy link
Copy Markdown
Contributor Author

@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