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
Clean up ComponentGraph
implementation
#2612
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2612 +/- ##
=======================================
- Coverage 99.9% 99.9% -0.0%
=======================================
Files 297 297
Lines 27039 27033 -6
=======================================
- Hits 26995 26989 -6
Misses 44 44
Continue to review full report at Codecov.
|
There was a problem hiding this 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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup! Left some questions, but idt anything blocking.
@@ -621,7 +621,7 @@ def test_time_series_pipeline_not_fitted_error( | |||
X, y = X_y_regression | |||
clf = time_series_regression_pipeline_class( | |||
parameters={ | |||
"Linear Regressor": {"n_jobs": 1}, | |||
"Random Forest Regressor": {"n_jobs": 1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this to RFR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bchen1116 I can't be 100% sure but due to the occasional issues we're running into with LinearRegressor for time series problems, it might be better to default to a more consistent estimator, but I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is trying to use the fixture time_series_regression_pipeline_class
which has a Random Forest Regressor, not Linear Regressor 😂 So just cleaning up the parameters so that it's actually used!
@pytest.fixture
def time_series_regression_pipeline_class():
class TSRegressionPipeline(TimeSeriesRegressionPipeline):
"""Random Forest Regression Pipeline for time series regression problems."""
component_graph = ["Delayed Feature Transformer", "Random Forest Regressor"]
def __init__(self, parameters, random_seed=0):
super().__init__(
self.component_graph, parameters=parameters, random_seed=random_seed
)
return TSRegressionPipeline
parent, component_outputs.get(f"{parent}.x") | ||
) | ||
if isinstance(parent_output, pd.Series): | ||
parent_output = pd.DataFrame(parent_output, columns=[parent]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we no longer need to change the series to a dataframe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no, this might have been outdated--we use ww's concat_columns
and it takes both series and dfs :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
@@ -621,7 +621,7 @@ def test_time_series_pipeline_not_fitted_error( | |||
X, y = X_y_regression | |||
clf = time_series_regression_pipeline_class( | |||
parameters={ | |||
"Linear Regressor": {"n_jobs": 1}, | |||
"Random Forest Regressor": {"n_jobs": 1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yessss
Closes #2518
I'm still skeptical about
fit_features
andcompute_final_component_features
being useful but at this point, they're basically just the public facing API for our pipelines to use_fit_transform_features_helper
. 🤷♀️