From 9de47a1ea0d00f3a2706bb49647207c2b3d54019 Mon Sep 17 00:00:00 2001 From: xzy Date: Mon, 13 Jan 2025 21:14:36 +0800 Subject: [PATCH] update ans --- examples/result_analysis/get_important_pattern.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/result_analysis/get_important_pattern.py b/examples/result_analysis/get_important_pattern.py index ceb57106..3db84b95 100644 --- a/examples/result_analysis/get_important_pattern.py +++ b/examples/result_analysis/get_important_pattern.py @@ -251,7 +251,7 @@ def get_forest_model_pattern(step2_data, metric_name): [col for col in step2_data.columns if (col.startswith("pipeline") or col.startswith("run_kwargs_pipeline"))]) X = step2_data.loc[:, columns] y = step2_data.loc[:, metric_name] - preprocessor = ColumnTransformer(transformers=[('onehot', OneHotEncoder(drop='first'), + preprocessor = ColumnTransformer(transformers=[('onehot', OneHotEncoder(drop='first', handle_unknown='ignore'), columns) # drop='first' to prevent dummy variable trap ]) pipeline = Pipeline(steps=[('preprocessor', preprocessor),