This change was initiated due to an issue identified when running the XGBoost model in our pipeline. XGBoost does not require preprocessing steps like imputation or scaling, and as a result, it should be run without any pipeline steps in certain cases. However, a bug was discovered where the pipeline setup failed if no preprocessing steps were provided, leading to incorrect estimator initialization. To address this, a fix was implemented to handle scenarios where the pipeline might be empty, ensuring proper configuration of the estimator regardless of the preprocessing steps.
Description
This PR fixes the initialization of the pipeline_steps and the assignment of the estimator in scenarios where the pipeline is provided and when it is not.
If pipeline_steps are provided (self.pipeline == True), the new estimator is appended to the existing steps.
If no pipeline steps are provided (self.pipeline == False), the estimator is directly initialized with the original estimator.
Changes:
Adds logic to ensure the proper handling of pipeline_steps whether a pipeline is present or not.
Deep copies the original estimator to avoid any unintended modifications to the original object.
Background
This change was initiated due to an issue identified when running the
XGBoost
model in our pipeline.XGBoost
does not require preprocessing steps like imputation or scaling, and as a result, it should be run without any pipeline steps in certain cases. However, a bug was discovered where the pipeline setup failed if no preprocessing steps were provided, leading to incorrect estimator initialization. To address this, a fix was implemented to handle scenarios where the pipeline might be empty, ensuring proper configuration of the estimator regardless of the preprocessing steps.Description
This PR fixes the initialization of the
pipeline_steps
and the assignment of theestimator
in scenarios where the pipeline is provided and when it is not.If
pipeline_steps
are provided (self.pipeline == True
), the new estimator is appended to the existing steps. If no pipeline steps are provided (self.pipeline == False
), the estimator is directly initialized with the original estimator.Changes:
pipeline_steps
whether a pipeline is present or not. Deep copies the original estimator to avoid any unintended modifications to the original object.Code Changes:
Reasoning
copy.deepcopy()
to preserve the original estimator's state.XGBoost
where no imputation or scaling steps are required, allowing it to run without additional pipeline steps.