[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
在学习线性回归的时候大多数教程会讲到RMSE,MSE(MAE提到的较少)这两个指标评价模型模型拟合的效果,当然MSE也就是模型的损失函数。
在分类模型中针对不同的数据我们可以用分类的准确度评价谁的模型效果较好,这两者的量纲是一致的,但是在回归中预测不同的实际场景,比如一个预测股市,一个预测房价,比较MSE或者RMSE就不能比较谁好谁坏;所以将
预测结果转换为准确度,结果都在[0, 1]之间,针对不同问题的预测准确度,可以比较并来判断此模型更适合预测哪个问题
1、计算方法
2、对公式的理解
*
:公式样式与MSE类似,可以理解为一个预测模型,只是该模型与x无关,在机器学习领域称这种模型为基准模型(Baseline
Model),适用于所有的线型回归算法;
* 基准模型问题:不没有考虑x的取值,只是很生硬的将所有的预测样本的预测结果都认为是样本y的均值
A)因此对公式可以这样理解:
* 分子是我们的模型预测产生的错误,分母是使用y等于y的均值这个模型所产生的错误
* 自己的模型预测产生的错误 / 基础模型预测生产的错误,表示自己的模型没有拟合住的数据,因此R2可以理解为,自己的模型拟合住的数据
B)公式推理结论:
* R2 <= 1
* R2越大越好,当自己的预测模型不犯任何错误时:R2 = 1
* 当我们的模型等于基准模型时:R2 = 0
* 如果R2 < 0,说明学习到的模型还不如基准模型。 #
注:很可能数据不存在任何线性关系,用线性回归之前可以先对数据进行相关性检验,或者先对数据的残差分布进行判定
3)公式变形
* R2 统计学上用来表示模型的拟合优度