简体   繁体   English

R编程中的下标越界错误

[英]subscript out of bounds error in R programming

Getting following error while using prophet library: 使用prophet库时出现以下错误:

Error in [<- ( *tmp* , m$history$t >= m$changepoints.t[i], i, value = 1) : subscript out of bounds [<-*tmp* ,m $ history $ t> = m $ changepoints.t [i],i,value = 1)出错:下标超出范围

Code : m <- prophet(data) this data I've loaded from csv file. 代码: m <- prophet(data)我从csv文件加载的这个数据。

My dataset looks like this : 我的数据集如下所示:

                   ds        y 
1 2017-05-23 08:07:00 21.16641
2 2017-05-23 08:07:10 16.79345
3 2017-05-23 08:07:20 16.40846
4 2017-05-23 08:07:30 16.24653
5 2017-05-23 08:07:40 16.14694
6 2017-05-23 08:07:50 15.89552

ds column is of following type : "POSIXct" "POSIXt" y column is of following type : "numeric" (these are log values of some count values) ds列具有以下类型: "POSIXct" "POSIXt" y列具有以下类型: "numeric" (这些是某些计数值的日志值)

Being new to R, i don't have any clue on how to resolve this. 作为R的新手,我对如何解决这个问题一无所知。 Please help. 请帮忙。

Your data does not have any change points (points of interest in your data series where there is change in the local trend direction). 您的数据没有任何变更点(数据系列中当地趋势方向发生变化的兴趣点)。 This error seems like a bug in the Prophet package which is not handling this situation gracefully. 这个错误似乎是先知包中的一个错误,它不能优雅地处理这种情况。 However you can fix this by setting the changepoint tuning parameters. 但是,您可以通过设置更改点调整参数来解决此问题。

Quick fix: set changespoints to 0 by using param: 快速修复:使用param将changepoints设置为0:

n.changepoints = 0

in your prophet call. 在你的先知召唤中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM