Closed digitech-ai closed 4 years ago
When you call the pipeline's fit()
method, it calls fit_transform()
sequentially on all transformers, passing the output of each call to the next, until it reaches the final estimator, for which it just calls the fit()
method.
Thanks for the clarification.
First we have created num_pipeline for data preprocessing for numerical columns. upon creating pipeline, fit_transform function is called to fit and transform the training data.
similarly full pipleline is build thats includes categorical columns too.
when we build another pipleine with predictor, that includes full pipeline and linear regression model. Only Fit method is called.
I understand that there is only fit and predict method for estimaters which is linear regression model in this case. but by just calling fit function , how does it understand transform function should get called for "full_pipeline".
Whereas if we just call housing_prepared = full_pipeline.fit(housing) It only fits the data, doesnt actually transform. For it to actually transform the data, we need transform either explicit transform or clubbing both by fit_transform.
Please clarify on this.