print("best estimator:\ {}format(grid best_estimator_)out[ ]best estimatorpipeline(steps=('standardscaler'standardscaler(copy=truewith_mean=truewith_std=true))('logisticregression'logisticregression( = class_weight=nonedual=falsefit_intercept=trueintercept_scaling= max_iter= multi_class='ovr'n_jobs= penalty=' 'random_state=nonesolver='liblinear'tol= verbose= warm_start=false))]this best_estimator_ in our case is pipeline with two stepsstandardscaler and logisticregression to access the logisticregression stepwe can use the named_steps attribute of the pipelineas explained earlierin[ ]print("logistic regression step:\ {}formatgrid best_estimator_ named_steps["logisticregression"])out[ ]logistic regression steplogisticregression( = class_weight=nonedual=falsefit_intercept=trueintercept_scaling= max_iter= multi_class='ovr'n_jobs= penalty=' 'random_state=nonesolver='liblinear'tol= verbose= warm_start=falsenow that we have the trained logisticregression instancewe can access the coefficients (weightsassociated with each input featurein[ ]print("logistic regression coefficients:\ {}formatgrid best_estimator_ named_steps["logisticregression"coef_)out[ ]logistic regression coefficients[[- - - - - - - - - - - - - - - - - - - - - - - - ]this might be somewhat lengthy expressionbut often it comes in handy in understanding your models algorithm chains and pipelines