From 49b56297e83614386ee894aa48ece179a679f545 Mon Sep 17 00:00:00 2001 From: Sander Vanden Hautte Date: Thu, 12 Aug 2021 15:25:21 +0200 Subject: [PATCH] Bugfix for #66: from_params() and from_pipeline() make a wrong call to the preprocessor constructor. --- cobra/preprocessing/preprocessor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cobra/preprocessing/preprocessor.py b/cobra/preprocessing/preprocessor.py index 3338ec4..9ecfa50 100644 --- a/cobra/preprocessing/preprocessor.py +++ b/cobra/preprocessing/preprocessor.py @@ -172,8 +172,7 @@ class encapsulating CategoricalDataProcessor, target_encoder = TargetEncoder(weight, imputation_strategy) - return cls(model_type, - categorical_data_processor, discretizer, target_encoder) + return cls(categorical_data_processor, discretizer, target_encoder) @classmethod def from_pipeline(cls, pipeline: dict): @@ -211,8 +210,7 @@ def from_pipeline(cls, pipeline: dict): target_encoder = TargetEncoder() target_encoder.set_attributes_from_dict(pipeline["target_encoder"]) - return cls(model_type, - categorical_data_processor, discretizer, target_encoder, + return cls(categorical_data_processor, discretizer, target_encoder, is_fitted=pipeline["_is_fitted"]) def fit(self, train_data: pd.DataFrame, continuous_vars: list,