在时间序列分析中计算rmse时获取错误消息 [英] Getting error message while calculating rmse in a time series analysis

查看:137
本文介绍了在时间序列分析中计算rmse时获取错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Keras在R中复制此时间序列分析的示例(请参阅

I am trying to replicate this example of time series analysis in R using Keras (see Here) and unfortunately I am receiving error message while computing first average rmes

coln <- colnames(compare_train)[4:ncol(compare_train)]
cols <- map(coln, quo(sym(.)))
rsme_train <-
  map_dbl(cols, function(col)
    rmse(
      compare_train,
      truth = value,
      estimate = !!col,
      na.rm = TRUE
    )) %>% mean()

rsme_train

错误消息:

is_symbol(x)中的错误:对象'.找不到

Error in is_symbol(x) : object '.' not found

文章的底部有一些有用的评论,但是dplyr的新版本并没有真正的帮助.任何建议如何解决这个问题?

There are some helpful comments at the bottom of the post but new version of dplyr doesn't help really. Any suggestion how to get around this?

推荐答案

我偶然发现了相同的问题,因此这里的解决方案与原始代码非常接近.

I stumbled upon the same problem, so here's a solution that is close to the original code.

cols的转换不是必需的,因为!!已经适用于字符向量.您可以将代码更改为

The transformation for cols is not necessary, because !! works with the character vector already. You can change the code to

coln <- colnames(compare_train)[4:ncol(compare_train)]
rsme_train <-
    map_df(coln, function(col)
        rmse(
            compare_train,
            truth = value,
            estimate = !!col,
            na.rm = TRUE
        )) %>% 
    pull(.estimate) %>%
    mean()

rsme_train

为确保确定性,您可能还想检查tidyverse的更新.

You might also want to check for updates of tidyverse, just to be sure.

这篇关于在时间序列分析中计算rmse时获取错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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