最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

R warning "There were missing values in resampled performance measures" when using caret with horizon is equal

programmeradmin4浏览0评论

I use the following codes to train time seires models:

Train time series model in caret provided by the caret author Max Kuhn

library(caret)
library(ggplot2)
data(economics)
myTimeControl <- trainControl(method = "timeslice",
                              initialWindow = 36,
                              horizon = 12,
                              fixedWindow = TRUE)

plsFitTime <- train(unemploy ~ pce + pop + psavert,
                    data = economics,
                    method = "pls",
                    preProc = c("center", "scale"),
                    trControl = myTimeControl)

The model works fine. But if the horizon in the trainControl function is equal one:

myTimeControl <- trainControl(method = "timeslice",
                              initialWindow = 36,
                              horizon = 1,
                              fixedWindow = TRUE)

I get the following warnings:

Warning message:
In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo,  :
  There were missing values in resampled performance measures.

The Rsuqared value is NA as shown below:

Partial Least Squares 

574 samples
  3 predictor

Pre-processing: centered (3), scaled (3) 
Resampling: Rolling Forecasting Origin Resampling (1 held-out with a fixed window) 
Summary of sample sizes: 36, 36, 36, 36, 36, 36, ... 
Resampling results across tuning parameters:

  ncomp  RMSE      Rsquared  MAE     
  1      650.8681  NaN       650.8681
  2      557.8639  NaN       557.8639

RMSE was used to select the optimal model using the smallest value.
The final value used for the model was ncomp = 2.

Given horizon = 1, I try to use other methods, such as ranger, lm, svmRadial, provided in the caret package, I always recive this warning. If horizon is bigger than 1, the model works.

So, I would like to know what this means and why?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论