Skip to content

Commit

Permalink
Changed feature logic
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbunn committed Oct 31, 2023
1 parent d555e9f commit 87e6607
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions evalml/pipelines/multiseries_regression_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,25 @@ def predict_in_sample(
self.input_target_name,
)
# Order series columns to be same as expected input feature names
X_unstacked = X_unstacked[list(self.input_feature_names.values())[0]]
X_train_unstacked = X_train_unstacked[
list(self.input_feature_names.values())[0]
input_features = list(self.input_feature_names.values())[0]
X_unstacked = X_unstacked[
[feature for feature in X_unstacked.columns if feature in input_features]
]
y_unstacked = y_unstacked[
y_train_unstacked.columns.intersection(y_unstacked.columns)
X_train_unstacked = X_train_unstacked[
[
feature
for feature in X_train_unstacked.columns
if feature in input_features
]
]
y_train_unstacked = y_train_unstacked[
y_train_unstacked.columns.intersection(y_unstacked.columns)
y_overlapping_features = [
feature
for feature in y_train_unstacked.columns
if feature in y_unstacked.columns
]
y_unstacked = y_unstacked[y_overlapping_features]
y_train_unstacked = y_train_unstacked[y_overlapping_features]

X_train_unstacked = infer_feature_types(X_train_unstacked)
y_train_unstacked = infer_feature_types(y_train_unstacked)
X_unstacked = infer_feature_types(X_unstacked)
Expand Down

0 comments on commit 87e6607

Please sign in to comment.