Description Usage Arguments Details Value Examples
View source: R/modeltime_wfs_heatmap.R
generate a heatmap for each recipe and model on a object generated with the modeltime_wfs_fit()
function.
1 2 3 4 5 6 | modeltime_wfs_heatmap(
.wfs_results,
metric = "rsq",
low_color = "#c7e9b4",
high_color = "#253494"
)
|
.wfs_results |
a tibble generated with the |
metric |
a metric the metric used for the heatmap values: 'mae', 'mape','mase','smape','rmse','rsq'. |
low_color |
color for the worst metric (highest error or lowest rsq). |
high_color |
color for the better metric (lowest error or highest rsq). |
assumes that the workflows included in the 'workflow_set' object are named M_name_of_model, since the .model_id is recipe_nameMname_of_model and the 'M' is used to separate the recipe from the model name.
a ggplot heatmap.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | library(modeltime)
library(dplyr)
library(parsnip)
library(earth)
data <- sknifedatar::data_avellaneda %>% mutate(date=as.Date(date)) %>% filter(date<'2011-01-01')
recipe_date <- recipes::recipe(value ~ ., data = data) %>%
recipes::step_date(date, features = c('dow','doy','week','month','year'))
mars_backward <- mars(prune_method ='backward', mode = 'regression') %>% set_engine('earth')
mars_forward <- mars(prune_method = 'forward', mode = 'regression') %>% set_engine('earth')
wfsets <- workflowsets::workflow_set(
preproc = list(
date = recipe_date),
models = list(M_mars_backward = mars_backward,
M_mars_forward = mars_forward),
cross = TRUE)
wffits <- sknifedatar::modeltime_wfs_fit(.wfsets = wfsets,
.split_prop = 0.6,
.serie=data)
sknifedatar::modeltime_wfs_heatmap(wffits, 'rsq')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.