an already underfit modelboth training and test set accuracy decrease relative to the default parameters finallylet' look at the coefficients learned by the models with the three different settings of the regularization parameter (figure - )in[ ]plt plot(logreg coef_ ' 'label=" = "plt plot(logreg coef_ '^'label=" = "plt plot(logreg coef_ ' 'label=" = "plt xticks(range(cancer data shape[ ])cancer feature_namesrotation= plt hlines( cancer data shape[ ]plt ylim(- plt xlabel("coefficient index"plt ylabel("coefficient magnitude"plt legend(as logisticregression applies an regularization by defaultthe result looks similar to that produced by ridge in figure - stronger regularization pushes coefficients more and more toward zerothough coefficients never become exactly zero inspecting the plot more closelywe can also see an interesting effect in the third coefficientfor "mean perimeter for = and = the coefficient is negativewhile for = the coefficient is positivewith magnitude that is even larger than for = interpreting model like thisone might think the coefficient tells us which class feature is associated with for exampleone might think that high "texture errorfeature is related to sample being "malignant howeverthe change of sign in the coefficient for "mean perimetermeans that depending on which model we look ata high "mean perimetercould be taken as being either indicative of "benignor indicative of "malignant this illustrates that interpretations of coefficients of linear models should always be taken with grain of salt supervised learning