Learn R Programming

caretForecast (version 0.1.3)

get_var_imp: Variable importance for forecasting model.

Description

Variable importance for forecasting model.

Usage

get_var_imp(object, plot = TRUE)

Value

A list class of "varImp.train". See varImp or a "trellis" plot.

Arguments

object

A list class of ARml or forecast object derived from ARml

plot

Boolean, if TRUE, variable importance will be ploted.

Author

Resul Akay

Examples

Run this code

train <- window(AirPassengers, end = c(1959, 12))

test <- window(AirPassengers, start = c(1960, 1))

ARml(train, caret_method = "lm", max_lag = 12,
 pre_process = "center") -> fit

forecast(fit, h = length(test), level = c(80,95)) -> fc

autoplot(fc)+ autolayer(test)

accuracy(fc, test)

get_var_imp(fc, plot = TRUE)


Run the code above in your browser using DataLab