The current implementation of our model tuner supports custom steps in two ways: by using predefined steps like impute or by specifying a scaler type via the scaler_type variable, and by defining custom steps in the pipeline_steps. Managing compatibility between these two approaches is leading to complex code and interaction issues between these variables. We have decided to fully adopt the pipeline_steps approach.
This issue will focus on ensuring that all functionalities (such as ADASYN and SMOTE) work smoothly with pipeline_steps and cleaning up legacy code that still uses the older variables like impute or scaler_type.
Problem
Complexity and Compatibility: The mix of custom steps in pipeline_steps and predefined variables (impute, scaler_type, etc.) creates complexity and potential for bugs, making the code harder to maintain and extend.
Interaction Issues: The way these variables interact leads to compatibility issues, especially when combining custom steps with predefined configurations.
Proposed Solution
Full Migration to pipeline_steps: Ensure that all other code paths, including ADASYN and SMOTE implementations, work with custom steps defined in pipeline_steps.
Code Cleanup: Once compatibility is confirmed or fixed, remove the legacy support for predefined variables like impute and scaler_type. The entire process should be managed via pipeline_steps.
Code
This code is a fix for the SMOTE and ADASYN sections but still contains support for the previous implementation.
if self.impute:
preproc_test = clone(self.estimator.named_steps["imputer"])
elif self.pipeline:
### Need to detect what the name of a column transformer has been called
### if we are using custom pipeline steps
preproc_test = clone(self.estimator.named_steps['Preprocessor'])
else:
pass
resampler_test = clone(self.estimator.named_steps["Resampler"])
Description
The current implementation of our model tuner supports custom steps in two ways: by using predefined steps like
impute
or by specifying a scaler type via thescaler_type
variable, and by defining custom steps in thepipeline_steps
. Managing compatibility between these two approaches is leading to complex code and interaction issues between these variables. We have decided to fully adopt thepipeline_steps
approach.This issue will focus on ensuring that all functionalities (such as ADASYN and SMOTE) work smoothly with
pipeline_steps
and cleaning up legacy code that still uses the older variables likeimpute
orscaler_type
.Problem
pipeline_steps
and predefined variables (impute
,scaler_type
, etc.) creates complexity and potential for bugs, making the code harder to maintain and extend.Proposed Solution
pipeline_steps
: Ensure that all other code paths, including ADASYN and SMOTE implementations, work with custom steps defined inpipeline_steps
.impute
andscaler_type
. The entire process should be managed viapipeline_steps
.Code
This code is a fix for the SMOTE and ADASYN sections but still contains support for the previous implementation.