线性回归之决定系数(coefficient of determination)
1. Sum Of Squares Due To Error
对于第i个观察点, 真实数据的Yi与估算出来的Yi-head的之间的差称为第i个residual, SSE 就是所有观察点的residual的和
2. Total Sum Of Squares
3. Sum Of Squares Due To Regression
通过以上我们能得到以下关于他们三者的关系
决定系数: 判断 回归方程 的拟合程度
(coefficient of determination)决定系数也就是说: 通过回归方程得出的 dependent variable 有 number% 能被 independent variable 所解释. 判断拟合的程度
(Correlation coefficient) 相关系数 : 测试dependent variable 和 independent variable 他们之间的线性关系有多强. 也就是说, independent variable 产生变化时 dependent variable 的变化有多大.
可以反映是正相关还是负相关
参考链接:http://blog.csdn.net/ytdxyhz/article/details/51730995
注意此决定系数不能用来衡量非线性回归的拟合优度
Why Is It Impossible to Calculate a Valid R-squared for Nonlinear Regression?
R-squared is based on the underlying assumption that you are fitting a linear model. If you aren’t fitting a linear model, you shouldn’t use it. The reason why is actually very easy to understand.
For linear models, the sums of the squared errors always add up in a specific manner: SS Regression + SS Error = SS Total.
This seems quite logical. The variance that the regression model accounts for plus the error variance adds up to equal the total variance. Further, R-squared equals SS Regression / SS Total, which mathematically must produce a value between 0 and 100%.
In nonlinear regression, SS Regression + SS Error do not equal SS Total! This completely invalidates R-squared for nonlinear models, and it no longer has to be between 0 and 100%.
参考链接:http://blog.minitab.com/blog/adventures-in-statistics-2/why-is-there-no-r-squared-for-nonlinear-regression
更新:
For cases other than fitting by ordinary least squares, the R2 statistic can be calculated as above and may still be a useful measure. If fitting is by weighted least squares or generalized least squares, alternative versions of R2 can be calculated appropriate to those statistical frameworks, while the "raw" R2 may still be useful if it is more easily interpreted. Values for R2 can be calculated for any type of predictive model, which need not have a statistical basis.
参考链接:https://en.wikipedia.org/wiki/Coefficient_of_determination
更新:
https://stats.stackexchange.com/questions/7357/manually-calculated-r2-doesnt-match-up-with-randomforest-r2-for-testing
这篇回答中给了两个信息:
(1)线性回归的R方等于实际值与预测值的相关系数的平方
(2)randomForest is reporting variation explained as opposed to variance explained.
线性回归之决定系数(coefficient of determination)的更多相关文章
- SAS学习笔记23 线性回归、多元回归
线性回归 由样本资料计算的回归系数b和其他统计量一样,存在抽样误差,因此,需要对线性回归方程进行假设检验 1.方差分析 2.t检验 相关系数的假设检验 相关系数(correlation coeffic ...
- 线性回归 Linear Regression
成本函数(cost function)也叫损失函数(loss function),用来定义模型与观测值的误差.模型预测的价格与训练集数据的差异称为残差(residuals)或训练误差(test err ...
- (原创)(三)机器学习笔记之Scikit Learn的线性回归模型初探
一.Scikit Learn中使用estimator三部曲 1. 构造estimator 2. 训练模型:fit 3. 利用模型进行预测:predict 二.模型评价 模型训练好后,度量模型拟合效果的 ...
- 线性回归中常见的一些统计学术语(RSE RSS TSS ESS MSE RMSE R2 Pearson's r)
TSS: Total Sum of Squares(总离差平方和) --- 因变量的方差 RSS: Residual Sum of Squares (残差平方和) --- 由误差导致的真实值和估计值 ...
- 时间序列预测——深度好文,ARIMA是最难用的(数据预处理过程不适合工业应用),线性回归模型简单适用,预测趋势很不错,xgboost的话,不太适合趋势预测,如果数据平稳也可以使用。
补充:https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-15-276 如果用arima的话,还不如使用随机森 ...
- 机器学习——Day 3 多元线性回归
写在开头 由于某些原因开始了机器学习,为了更好的理解和深入的思考(记录)所以开始写博客. 学习教程来源于github的Avik-Jain的100-Days-Of-MLCode 英文版:https:// ...
- Python - 线性回归(Linear Regression) 的 Python 实现
背景 学习 Linear Regression in Python – Real Python,前面几篇文章分别讲了"regression怎么理解","线性回归怎么理解& ...
- Python学习笔记-StatsModels 统计回归(1)线性回归
1.背景知识 1.1 插值.拟合.回归和预测 插值.拟合.回归和预测,都是数学建模中经常提到的概念,而且经常会被混为一谈. 插值,是在离散数据的基础上补插连续函数,使得这条连续曲线通过全部给定的离散数 ...
- 莫烦python教程学习笔记——线性回归模型的属性
#调用查看线性回归的几个属性 # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # ...
随机推荐
- Matlab中的基本数据类型介绍
Matlab中支持的数据类型包括: 逻辑(logical)字符(char)数值(numeric)元胞数组(cell)结构体(structure)表格(table)函数句柄(function handl ...
- 将矩阵数据转换为栅格图 filled.contour()
require(grDevices) # for colours filled.contour(volcano, color = terrain.colors, asp = 1) # simple x ...
- kafka+docker+python
昨天晚上刚刚才花3小时看完<日志:每个软件工程师都应该知道的有关实时数据的统一概念>. 今天就把kafka在docker容器里运行起来,github上有几个,但都太复杂了. 我自己写个最简 ...
- AD中的library中有些文件的后缀有.intlib .schlib .pcblib 这些都是库文件,但有什么区别呢?
intlib 是集成原理图和PCB封装的 schlib .只有原理图 pcblib 只有PCB封装 参考资料 1 https://zhidao.baidu.com/question/259298801 ...
- js,java时间处理
1.JS获取时间格式为“yyyy-MM-dd HH:mm:ss”的字符串 function getTimeStr(){ var myDate = new Date(); var year = myDa ...
- echart 注意事项-初始化和销毁
net5x 博客园 首页 新随笔 联系 管理 订阅 随笔- 21 文章- 186 评论- 4 ECharts图表初级入门(三):ECharts对象的数据实例化方法汇总以及注意事项 [摘要]: ...
- 解决ios下的微信页面背景音乐无法自动播放问题
在做各种html5场景页面的时候,插入背景音乐是一个很普遍的需求,我们都知道,ios下的safari是无法自动播放音乐的,以至于现在行程一种认知,ios是没有办法自动播放媒体资源的,这个认知其实是错误 ...
- Go语言学习之7 接口实例、终端文件读写、异常处理
本节主要内容: 1. 终端读写2. 文件读写3. 命令行参数4. Json5. 自定义错误 1. 终端读写 操作终端相关文件句柄常量 os.Stdin:标准输入 os.Stdout:标准输 ...
- 雷林鹏分享:jQuery EasyUI 表单 - 创建异步提交表单
jQuery EasyUI 表单 - 创建异步提交表单 本教程向您展示如何通过 easyui 提交一个表单(Form).我们创建一个带有 name.email 和 phone 字段的表单.通过使用 e ...
- p2739 Shuttle Puzzle
观察样例得知就是和离'_'左边最近的'w'交换位置,然后和离'_'右边最近的'b'交换位置,轮流进行. #include <iostream> #include <cstdio> ...