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

Added ability to utilize instantiated components when creating a pipeline #2643

Merged
merged 6 commits into from Aug 18, 2021

Conversation

christopherbunn
Copy link
Contributor

@christopherbunn christopherbunn commented Aug 16, 2021

As part of #2587, we will need to be able to create new pipelines using already trained components. When creating new pipelines ensemble pipelines, the AutoML algorithm will be choosing from the best previously trained pipelines to create one large ensembling pipeline. Rather than creating an entirely new ensembling pipeline with the best parameters and retraining the entire pipeline, we can just utilize the pre-trained components and train only the final estimator.

This PR adds support for using already instantiated components when creating a new pipeline. When an instantiated component is passed through a dictionary, the existing object is used rather than the current behavior of raising an error.

@christopherbunn christopherbunn force-pushed the instantiate_use_fitted_components branch from 697ba7c to 61d57c0 Compare August 16, 2021 21:16
@codecov
Copy link

codecov bot commented Aug 16, 2021

Codecov Report

Merging #2643 (d37afd9) into main (7231a38) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2643     +/-   ##
=======================================
+ Coverage   99.9%   99.9%   +0.1%     
=======================================
  Files        298     298             
  Lines      27086   27098     +12     
=======================================
+ Hits       27042   27054     +12     
  Misses        44      44             
Impacted Files Coverage Δ
evalml/pipelines/component_graph.py 99.7% <100.0%> (+0.1%) ⬆️
evalml/pipelines/components/utils.py 100.0% <100.0%> (ø)
...valml/tests/pipeline_tests/test_component_graph.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7231a38...d37afd9. Read the comment docs.

@christopherbunn christopherbunn force-pushed the instantiate_use_fitted_components branch 2 times, most recently from b0ed3b1 to 5133635 Compare August 17, 2021 22:41
@christopherbunn christopherbunn marked this pull request as ready for review August 18, 2021 14:19
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.

This looks good to me! Should be a pretty solid upgrade to performance. Do you have perf tests to see what the time to fit consequences are for ensembling pipelines? This would be an AMAZING demo.

Copy link
Contributor

@angela97lin angela97lin left a comment

Choose a reason for hiding this comment

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

I think this looks really good! Left one testing suggestion, to make sure that on the CG/pipeline level, all of the parameters are as we expect but 🚢

}
cg = ComponentGraph(graph)
cg.instantiate({"Imputer": {}})
assert graph["Imputer"][0] == cg.get_component("Imputer")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a test that the component instance's set parameters are still kept in the component graph / pipeline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated test to make sure that existing parameters are not changed during instantiation.

@christopherbunn christopherbunn force-pushed the instantiate_use_fitted_components branch 2 times, most recently from 2a12f5e to 2d7c67c Compare August 18, 2021 20:45
@christopherbunn christopherbunn force-pushed the instantiate_use_fitted_components branch from 2d7c67c to d37afd9 Compare August 18, 2021 21:08
@christopherbunn christopherbunn merged commit 869cbaa into main Aug 18, 2021
@chukarsten chukarsten mentioned this pull request Aug 19, 2021
@freddyaboulton freddyaboulton deleted the instantiate_use_fitted_components branch May 13, 2022 15:02
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.

None yet

3 participants