From 1be80d56233e48882def39f39794e6a209f95fd1 Mon Sep 17 00:00:00 2001 From: Ravin Kohli Date: Fri, 19 Aug 2022 15:36:03 +0200 Subject: [PATCH] remove using categorical columns --- .../TabularColumnTransformer.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/autoPyTorch/pipeline/components/preprocessing/tabular_preprocessing/TabularColumnTransformer.py b/autoPyTorch/pipeline/components/preprocessing/tabular_preprocessing/TabularColumnTransformer.py index 44cdeb117..58a55a1df 100644 --- a/autoPyTorch/pipeline/components/preprocessing/tabular_preprocessing/TabularColumnTransformer.py +++ b/autoPyTorch/pipeline/components/preprocessing/tabular_preprocessing/TabularColumnTransformer.py @@ -59,7 +59,6 @@ def fit(self, X: Dict[str, Any], y: Any = None) -> "TabularColumnTransformer": column_transformers: List[Tuple[str, BaseEstimator, List[int]]] = [] numerical_pipeline = 'passthrough' - categorical_pipeline = 'passthrough' encode_pipeline = 'passthrough' if len(preprocessors['numerical']) > 0: @@ -68,12 +67,6 @@ def fit(self, X: Dict[str, Any], y: Any = None) -> "TabularColumnTransformer": column_transformers.append( ('numerical_pipeline', numerical_pipeline, X['dataset_properties']['numerical_columns']) ) - if len(preprocessors['categorical']) > 0: - categorical_pipeline = make_pipeline(*preprocessors['categorical']) - - column_transformers.append( - ('categorical_pipeline', categorical_pipeline, X['dataset_properties']['categorical_columns']) - ) if len(preprocessors['encode']) > 0: encode_pipeline = make_pipeline(*preprocessors['encode']) @@ -82,6 +75,12 @@ def fit(self, X: Dict[str, Any], y: Any = None) -> "TabularColumnTransformer": ('encode_pipeline', encode_pipeline, X['encode_columns']) ) + # if len(preprocessors['categorical']) > 0: + # categorical_pipeline = make_pipeline(*preprocessors['categorical']) + # column_transformers.append( + # ('categorical_pipeline', categorical_pipeline, X['dataset_properties']['categorical_columns']) + # ) + # in case the preprocessing steps are disabled # i.e, NoEncoder for categorical, we want to # let the data in categorical columns pass through