Skip to content

Commit

Permalink
adding a more informative message when target column isn't present
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Mar 5, 2024
1 parent 457b1c8 commit 4283647
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sageworks/core/artifacts/endpoint_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ def inference(self, eval_df: pd.DataFrame, capture_uuid: str = None) -> pd.DataF
# Get the target column
target_column = ModelCore(self.model_name).target()

# Sanity Check that the target column is present
if target_column not in prediction_df.columns:
self.log.warning(f"Target Column {target_column} not found in prediction_df!")
self.log.warning("In order to compute metrics, the target column must be present!")
return prediction_df

# Compute the standard performance metrics for this model
model_type = self.model_type()
if model_type == ModelType.REGRESSOR.value:
Expand Down

0 comments on commit 4283647

Please sign in to comment.