From c7e197bb7ed6d1876137af2a5303cdb4028f4758 Mon Sep 17 00:00:00 2001 From: jpgard Date: Fri, 29 Dec 2023 16:10:29 -0700 Subject: [PATCH] leave any unmapped numeric features as numerics --- tableshift/core/features.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tableshift/core/features.py b/tableshift/core/features.py index 6de7c3e075..e8806cb49d 100644 --- a/tableshift/core/features.py +++ b/tableshift/core/features.py @@ -540,6 +540,11 @@ def get_passthrough_columns(self, data: pd.DataFrame, if self.config.numeric_features == "passthrough": passthrough_columns += get_numeric_columns(data) + elif self.config.numeric_features == "map_values": + # add any unmapped numeric columns + unmapped_numerics = [f for f in get_numeric_columns(data) if self.feature_list[f].value_mapping is None] + passthrough_columns += unmapped_numerics + if self.config.categorical_features == "passthrough": passthrough_columns += get_categorical_columns(data) @@ -550,7 +555,8 @@ def get_passthrough_columns(self, data: pd.DataFrame, passthrough_columns.append(domain_label_colname) if not self.config.map_targets: passthrough_columns.append(target_colname) - return passthrough_columns + + return list(set(passthrough_columns)) def map_names_extended(self, colnames: List[str]) -> List[str]: """Map the original feature names to any extended feature names."""