I am working on ML regression problem where I defined a pipeline like below based on a tutorial online.
My code looks like below
pipe1 = Pipeline([('poly', PolynomialFeatures()),
('fit', linear_model.LinearRegression())])
pipe2 = Pipeline([('poly', PolynomialFeatures()),
('fit', linear_model.Lasso())])
pipe3 = Pipeline([('poly', PolynomialFeatures()),
('fit', linear_model.Ridge())])
pipe4 = Pipeline([('poly', PolynomialFeatures()),
('fit', linear_model.TweedieRegressor())])
models3 = {'OLS': pipe1,
'Lasso': GridSearchCV(pipe2,
param_grid=lasso_params).fit(X_train,y_train).best_estimator_ ,
'Ridge': GridSearchCV(pipe3,
param_grid=ridge_params).fit(X_train,y_train).best_estimator_,
'Tweedie':GridSearchCV(pipe4,
param_grid=tweedie_params).fit(X_train,y_train).best_estimator_}
test(models3, df)
While the above code worked fine and gave me the results, how can I get the list of polynomial features that were created?
Or how can I view them in the dataframe?