学习笔记,仅供参考,有错必纠
PS : 本BLOG采用中英混合模式,有些英文下有中文翻译(并不是博主翻译的)
文章目录
- 衡量回归模型的效果
- 衡量效果的定量度量
- 方差-偏差的权衡
衡量回归模型的效果
衡量效果的定量度量
When the outcome is a number(当结果变量是数值时), the most common method for characterizing a model’s predictive capabilities is to use the root mean squared error(RMSE):
This metric is a function of the model residuals(模型残差的函数), which are the observed values minus the model predictions. The mean squared error (MSE) is calculated by squaring the residuals and summing them.The RMSE is then calculated by taking the square root of the MSE so that it is in the same units as the original data(与原始数据是同样单位).
得到RMSE取值通常解释为(平均意义上)残差距离0的远近,或者解释为观测值与模型预测值之间的平均距离。
Another common metric is the coefficient of determination, commonly written as :
This value can be interpreted as the proportion of the information in the data that is explained by the model.
While this is an easily interpretable statistic, the practitioner must remember that is a measure of correlation, not accuracy(一种相关性的度量,而不是准确性的度量).
It is also important to realize that is dependent on the variation in the outcome(结果的变异). Using the interpretation that this statistic measures the proportion of variance explained by the model(模型所能解释的方差的比例), one must remember that the denominator of that proportion(比例的分母) is calculated using the sample variance of the outcome.
Practically speaking, this dependence on the outcome variance can also have a drastic effect on how the model is viewed.
- 翻译
从实际问题来说,依赖于结果变量方差这一事实同样会对我们如何看待模型产生巨大影响。
In some cases, the goal of the model is to simply rank new samples(对新样本进行排序).In this situation, determining the rank correlation(秩相关系数) between the observed and predicted values might be a more appropriate metric(恰当的度量).
The rank correlation takes the ranks of the observed outcome values (as opposed to their actual numbers) and evaluates how close these are to ranks of the model predictions. To calculate this value, the ranks of the observed and predicted outcomes are obtained and the correlation coefficient between
these ranks is calculated. This metric is commonly known as Spearman’s rank correlation(Spearman秩相关系数).
方差-偏差的权衡
MSE可以进一步分解为更明确的几个部分,如果假设数据点是统计独立的,并且残差具有理论上的零均值和常数方差,那么:
The first part () is usually called “irreducible noise”(不可约噪音) and cannot be eliminated by modeling(无法通过建模来削弱).
The second term is the squared bias of the model. This reflects how close the functional form of the model can get to the true relationship between the predictors and the outcome.
- 翻译
第二部分是模型偏差,这一项反映了模型的函数形式与预测变量、结果变量之间真实关系的接近程度。
The last term is the model variance.
我们看下面这张图,它展示了两个极端情况,分别是高偏差(红线)和高方差(蓝线):
数据是模拟出的正弦波。红色部分表示的模型将数据分成了两半,并且将每一半的数据预测为该部分的均值。这个模型具有很小的方差,因为如果换了另外一组用同样的方式生成的数据,该模型并不会有很大的变化。然而,这个模型在拟合数据方面是很差的,因为模型过于简单,导致它有很高的偏差。相反,蓝线具有较低的偏差,但数据中任何微小的扰动都会极大地改变模型,因为这点,它具有很高的方差。
一般而言,复杂的模型通常有着很高的方差,这会导致过度拟合。另一方面,简单的模型如果没有足够的灵活性来刻画真实变量关系,那么通常会拟合不足。此外,高度相关的自变量可能会导致共线性,这会极大地增加模型的方差,我们之后会讨论一些通过增加偏差来极大减小方差的模型,它们可以作为减轻多重共线性的一种途径,这就是所谓的方差-偏差的权衡.