diff --git a/docs/changelog.md b/docs/changelog.md index 47cb5c7..4300a64 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -7,10 +7,12 @@ v0.6.0 (, 2023) =============== * Enhancements * Fixes + * Rename `_execute_operations_on_df` to `target` in executed prediction problem dataframe [#124][#124] * Clean up operation description generation [#118][#118] * Remove PredictionProblemEvaluator [#118][#118] * Remove FeaturetoolsWrapper class [#100][#100] + [#124]: [#118]: diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index 8010535..4f5f57e 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -103,7 +103,7 @@ def generate_and_verify_prediction_problem( if not use_multiprocess: label_times = p.execute(df, -1) assert label_times.target_dataframe_index == entity_col - # TODO: fix bug with Filter Operation results in labels that has _execute_operations_on_df == 0 + # TODO: fix bug with Filter Operation results in labels that has target == 0 # Below is not an ideal way to check the prediction problems # (because it has less than, rather than exact number of unique instances) if not label_times.empty: @@ -120,7 +120,7 @@ def generate_and_verify_prediction_problem( def check_label_times(label_times, entity_col, unique_entity_ids): assert label_times.target_dataframe_index == entity_col - # TODO: fix bug with Filter Operation results in labels that has _execute_operations_on_df == 0 + # TODO: fix bug with Filter Operation results in labels that has target == 0 # Below is not an ideal way to check the prediction problems # (because it has less than, rather than exact number of unique instances) if not label_times.empty: diff --git a/tests/test_prediction_problem.py b/tests/test_prediction_problem.py index 8eba5ac..c81bfde 100644 --- a/tests/test_prediction_problem.py +++ b/tests/test_prediction_problem.py @@ -107,7 +107,7 @@ def verify_problems(problems, df, cutoff_strategy): problems = sorted(problems) for p in problems: label_times = p.execute(df, -1) - label_times.rename(columns={"_execute_operations_on_df": "label"}, inplace=True) + label_times.rename(columns={"target": "label"}, inplace=True) threshold = p.operations[0].threshold if str(p) == "For each predict the number of records in next 2d days": diff --git a/trane/core/prediction_problem.py b/trane/core/prediction_problem.py index aa5079c..e9d8fb5 100755 --- a/trane/core/prediction_problem.py +++ b/trane/core/prediction_problem.py @@ -159,6 +159,7 @@ def execute( ) if "__identity__" in df.columns: df.drop(columns=["__identity__"], inplace=True) + lt = lt.rename(columns={"_execute_operations_on_df": "target"}) return lt def _execute_operations_on_df(self, df: pd.DataFrame):