Skip to content

Commit

Permalink
Bug Fix : Dropping target column if present in additional data (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosler authored Nov 7, 2023
2 parents 890a4d3 + a7ebb8b commit a87733a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ads/opctl/operator/lowcode/forecast/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ def _build_indexed_datasets(
data["__Series__"] = _merge_category_columns(data, target_category_columns)
unique_categories = data["__Series__"].unique()
invalid_categories = []
if additional_data is not None and target_column in additional_data.columns:
logger.warn(f"Dropping column '{target_column}' from additional_data")
additional_data.drop(target_column, axis=1, inplace=True)
for cat in unique_categories:
data_by_cat = data[data["__Series__"] == cat].rename(
{target_column: f"{target_column}_{cat}"}, axis=1
Expand Down

0 comments on commit a87733a

Please sign in to comment.