combine_modeltime_tables: Combine multiple Modeltime Tables into a single Modeltime...

View source: R/helpers-modeltime_table.R

combine_modeltime_tablesR Documentation

Combine multiple Modeltime Tables into a single Modeltime Table

Description

Combine multiple Modeltime Tables into a single Modeltime Table

Usage

combine_modeltime_tables(...)

Arguments

...

Multiple Modeltime Tables (class mdl_time_tbl)

Details

This function combines multiple Modeltime Tables.

  • The .model_id will automatically be renumbered to ensure each model has a unique ID.

  • Only the .model_id, .model, and .model_desc columns will be returned.

Re-Training Models on the Same Datasets

One issue can arise if your models are trained on different datasets. If your models have been trained on different datasets, you can run modeltime_refit() to train all models on the same data.

Re-Calibrating Models

If your data has been calibrated using modeltime_calibrate(), the .test and .calibration_data columns will be removed. To re-calibrate, simply run modeltime_calibrate() on the newly combined Modeltime Table.

See Also

  • combine_modeltime_tables(): Combine 2 or more Modeltime Tables together

  • add_modeltime_model(): Adds a new row with a new model to a Modeltime Table

  • update_modeltime_description(): Updates a description for a model inside a Modeltime Table

  • update_modeltime_model(): Updates a model inside a Modeltime Table

  • pull_modeltime_model(): Extracts a model from a Modeltime Table

Examples

library(modeltime)
library(tidymodels)
library(tidyverse)
library(timetk)
library(lubridate)

# Setup
m750 <- m4_monthly %>% filter(id == "M750")

splits <- time_series_split(m750, assess = "3 years", cumulative = TRUE)

model_fit_arima <- arima_reg() %>%
    set_engine("auto_arima") %>%
    fit(value ~ date, training(splits))

model_fit_prophet <- prophet_reg() %>%
    set_engine("prophet") %>%
    fit(value ~ date, training(splits))

# Multiple Modeltime Tables
model_tbl_1 <- modeltime_table(model_fit_arima)
model_tbl_2 <- modeltime_table(model_fit_prophet)

# Combine
combine_modeltime_tables(model_tbl_1, model_tbl_2)


modeltime documentation built on June 8, 2022, 1:07 a.m.