R中的RMSE(均方根偏差)计算 [英] RMSE (root mean square deviation) calculation in R

查看:342
本文介绍了R中的RMSE(均方根偏差)计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对目标变量 Wavelength 具有数值特征观测值 V1 V12 .我想计算 Vx 列之间的RMSE.数据格式如下.

I have numeric feature observations V1 through V12 taken for a target variable Wavelength. I would like to calculate the RMSE between the Vx columns. Data format is below.

每个变量"Vx"以5分钟为间隔进行测量.我想计算所有Vx变量的观测值之间的RMSE,该怎么做?

Each variable "Vx" is measured at a 5-minute interval. I would like to calculate the RMSE between the observations of all Vx variables, how do I do that?

这是我找到的链接,但是我不确定如何获取y_pred: https://www.kaggle.com/wiki/RootMeanSquaredError

This is a link I found, but I'm not sure how I can get y_pred: https://www.kaggle.com/wiki/RootMeanSquaredError

对于下面提供的链接,我认为我没有预测值: http://heuristically.wordpress.com/2013/07/12/calculate-rmse-and-mae-in-r-sas/

For the link provided below, I don't think I have the predicted values: http://heuristically.wordpress.com/2013/07/12/calculate-rmse-and-mae-in-r-and-sas/

推荐答案

下面的函数将为您提供RMSE:

The function below will give you the RMSE:

RMSE = function(m, o){
  sqrt(mean((m - o)^2))
}

m 用于模型(拟合)值, o 用于观察(真实)值.

m is for model (fitted) values, o is for observed (true) values.

这篇关于R中的RMSE(均方根偏差)计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆