coefficientsand its performance on the training set how much importance the model places on simplicity versus training set performance can be specified by the userusing the alpha parameter in the previous examplewe used the default parameter alpha= there is no reason why this will give us the best trade-offthough the optimum setting of alpha depends on the particular dataset we are using increasing alpha forces coefficients to move more toward zerowhich decreases training set performance but might help generalization for examplein[ ]ridge ridge(alpha= fit(x_trainy_trainprint("training set score{ }format(ridge score(x_trainy_train))print("test set score{ }format(ridge score(x_testy_test))out[ ]training set score test set score decreasing alpha allows the coefficients to be less restrictedmeaning we move right in figure - for very small values of alphacoefficients are barely restricted at alland we end up with model that resembles linearregressionin[ ]ridge ridge(alpha= fit(x_trainy_trainprint("training set score{ }format(ridge score(x_trainy_train))print("test set score{ }format(ridge score(x_testy_test))out[ ]training set score test set score herealpha= seems to be working well we could try decreasing alpha even more to improve generalization for nownotice how the parameter alpha corresponds to the model complexity as shown in figure - we will discuss methods to properly select parameters in we can also get more qualitative insight into how the alpha parameter changes the model by inspecting the coef_ attribute of models with different values of alpha higher alpha means more restricted modelso we expect the entries of coef_ to have smaller magnitude for high value of alpha than for low value of alpha this is confirmed in the plot in figure - supervised learning