Skip to content

Commit

Permalink
updated test to infer type
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbunn committed Nov 1, 2023
1 parent fa437a1 commit 95e6681
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions evalml/pipelines/multiseries_regression_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ def predict_in_sample(
self.time_index,
self.input_target_name,
)

# Order series columns to be same as expected input feature names
# and filter to only include features in `X_unstacked`.
input_features = list(self.input_feature_names.values())[0]
X_unstacked = X_unstacked[

Check warning on line 135 in evalml/pipelines/multiseries_regression_pipeline.py

View check run for this annotation

Codecov / codecov/patch

evalml/pipelines/multiseries_regression_pipeline.py#L134-L135

Added lines #L134 - L135 were not covered by tests
[feature for feature in input_features if feature in X_unstacked.columns]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from evalml.pipelines import MultiseriesRegressionPipeline
from evalml.pipelines.utils import unstack_multiseries
from evalml.preprocessing import split_multiseries_data
from evalml.utils import infer_feature_types

Check warning on line 11 in evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py#L11

Added line #L11 was not covered by tests


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -123,6 +124,7 @@ def test_multiseries_pipeline_predict_in_sample(
)
if include_series_id:
expected = pd.concat([X_holdout["series_id"], expected], axis=1)
expected = infer_feature_types(expected)
pd.testing.assert_frame_equal(y_pred, expected)

Check warning on line 128 in evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py#L125-L128

Added lines #L125 - L128 were not covered by tests
else:
pd.testing.assert_series_equal(y_pred, expected)

Check warning on line 130 in evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py#L130

Added line #L130 was not covered by tests
Expand Down

0 comments on commit 95e6681

Please sign in to comment.