Question 3 - how to get coeff on a pipeline

Hi ! I’m trying to obtain the coef value to answer the 3d question. For the previous ones, I obteined it manualy by looking at each line of the estimator. I cannot find a way to extract all the values to make the plot. I always get error messages similar to : not working on a list, or pipeline has not coeff attribute. I even tried to concatenate all the values as a dataframe, but i failed. Can someone explain to me how to get the coef values on a pipeline ?

You need to access the classifier that is in the pipeline. Thus you can access using model[-1].coef_ to pick-up the last estimator of the model and get the coefficients.