Shows the effect of collinearity in the coefficients of an estimator.
Ridge Regression is the estimator used in this example. Each color represents a different feature of the coefficient vector, and this is displayed as a function of the regularization parameter.
This example also shows the usefulness of applying Ridge regression to highly ill-conditioned matrices. For such matrices, a slight change in the target variable can cause huge variances in the calculated weights. In such cases, it is useful to set a certain regularization (alpha) to reduce this variation (noise).
When alpha is very large, the regularization effect dominates the squared loss function and the coefficients tend to zero. At the end of the path, as alpha tends toward zero and the solution tends towards the ordinary least
python学习之绘制一个规范化函数的Ridge协因子图形
于 2022-05-08 07:59:38 首次发布
该博客展示了在估计器中共线性如何影响系数,并以岭回归为例进行说明。通过改变正则化参数,观察不同特征的系数变化。在高度病态矩阵情况下,轻微目标变量变化可能导致权重极大波动,此时设定合适的正则化(α)能减少这种波动。随着α增大,正则化影响增强,系数趋向于零;当α接近零时,解趋向最小二乘法,系数出现大幅振荡。实际应用中需平衡损失函数与正则化项。
摘要由CSDN通过智能技术生成