From 293a7b936b8df95209282d074a384b327fc316bd Mon Sep 17 00:00:00 2001 From: iburakov Date: Wed, 23 Aug 2023 17:39:55 +0000 Subject: [PATCH] Fix bool preprocessing (preseve missing as 0) This breaks backwards compatibility with previous models, but evaluation showed it improves ML-based synthesis performance significantly. --- .../src/components/data_processing/feature_engineering.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ml/synthesis/src/components/data_processing/feature_engineering.py b/ml/synthesis/src/components/data_processing/feature_engineering.py index c8e271e2c..1dfc5bd41 100644 --- a/ml/synthesis/src/components/data_processing/feature_engineering.py +++ b/ml/synthesis/src/components/data_processing/feature_engineering.py @@ -9,8 +9,7 @@ def _map_bool(c): - # TODO: 1 - 0 - -1 mapping - return c.apply(lambda v: 1 if v is True else (0 if v is False else v)) + return c.apply(lambda v: 1 if v is True else (-1 if v is False else 0)) def _map_categorical(df, c):