Repository navigation
Remove linearized_component_graph and ComponentGraph.from_list - #2556
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2556 +/- ##
=======================================
+ Coverage 99.9% 99.9% +0.1%
=======================================
Files 285 285
Lines 26212 26097 -115
=======================================
- Hits 26176 26063 -113
+ Misses 36 34 -2
Continue to review full report at Codecov.
|
| * Fixes | ||
| * Changes | ||
| * Removed ``ComponentGraph.from_list`` and update PipelineBase implementation for creating pipelines from a list of components :pr:`2549` | ||
| * Updated ``PipelineBase`` implementation for creating pipelines from a list of components :pr:`2549` |
There was a problem hiding this comment.
Updating release notes to make clear that this is actually the PR that removed from_list :)
| ] | ||
|
|
||
| component_graph = ComponentGraph.from_list(["Imputer", "One Hot Encoder"]) | ||
| component_graph = ComponentGraph({"Imputer": ["Imputer", "X", "y"]}) |
There was a problem hiding this comment.
I thought this test still had validity: it was testing that get_estimators when a component graph has no estimators will return an empty list. I'm just changing how the graph is initialized :)
| "Logistic Regression Classifier", | ||
| ] | ||
| component_graph = ComponentGraph.from_list(component_list) | ||
| component_graph = { |
There was a problem hiding this comment.
Again, I thought this could be valuable to keep around even though the original test (does y value get passed even though edge from standard scaler is unclear?) is different; still valuable to double check that we are indeed getting the oversampled y :)
There was a problem hiding this comment.
Just a tad confused by does y value get passed even though edge from standard scaler is unclear?, we're not expecting it to be passed right?
There was a problem hiding this comment.
Before this PR, we expect that the oversampler's y value gets passed to the estimator because standard scaler doesn't produce a y value so the "most recent y" value the estimator sees is still the oversampler's y, but this isn't really clear using the list API.
Now that we're specifying edges, it's more clear that the estimator gets the oversampler's y edge, which would have meant that this test isn't necessary to confirm that anymore, but I wanted to keep it around anyways in the case that the estimator does not get the oversampler's y :)
| "Logistic Regression Classifier", | ||
| ] | ||
| component_graph = ComponentGraph.from_list(component_list) | ||
| component_graph = { |
There was a problem hiding this comment.
Just a tad confused by does y value get passed even though edge from standard scaler is unclear?, we're not expecting it to be passed right?
|
|
||
| @patch("evalml.pipelines.components.estimators.RandomForestClassifier.fit") | ||
| @patch("evalml.pipelines.components.estimators.DecisionTreeClassifier.fit") | ||
| def test_component_graph_sampler_same_given_components(mock_dt_fit, mock_rf_fit): |
There was a problem hiding this comment.
I'm not sure what the original purpose of this test was, just verifying that SMOTE Oversampler was included in both graphs?
There was a problem hiding this comment.
I think it was just testing that with different estimators that the oversampler was the same and received the same input :)
| pd.testing.assert_series_equal(answer, expected) | ||
|
|
||
|
|
||
| lists = [ |
There was a problem hiding this comment.
Goodnight dear lists
#2549 removed almost all usages of
ComponentGraph.from_listbut didn't actually remove the method 😂This PR does that, and removes the idea of
linearized_component_graph. I think this is a good idea because this method assumes that there is a way to make something "linear", which is suspicious in DAG cases. In addition, most places where our code currently uses this can be easily replaced withcomponent_instances, which makes me suspicious that order did not really matter; instead,linearized_component_graphwas used as a convenient way to get component name mapping to the component class. If this is useful, it should be revamped into a simple dictionary, but for now, functionality is covered bycomponent_instances.