diff --git a/evalml/pipelines/multiseries_regression_pipeline.py b/evalml/pipelines/multiseries_regression_pipeline.py index 38c53ec5a4..948ce040c5 100644 --- a/evalml/pipelines/multiseries_regression_pipeline.py +++ b/evalml/pipelines/multiseries_regression_pipeline.py @@ -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[ [feature for feature in input_features if feature in X_unstacked.columns] diff --git a/evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py b/evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py index 73e3163af0..da188fd04d 100644 --- a/evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py +++ b/evalml/tests/pipeline_tests/regression_pipeline_tests/test_multiseries_regression_pipeline.py @@ -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 @pytest.fixture(scope="module") @@ -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) else: pd.testing.assert_series_equal(y_pred, expected)