calibrate_and_plot: ML Calibrate and Plot

View source: R/jofou_ML.R

calibrate_and_plotR Documentation

ML Calibrate and Plot

Description

Perform modeltime calibrate and plot function at the same time.

Usage

calibrate_and_plot(..., type = "testing")

Arguments

...

A fitted model object that is either:

  1. A modeltime table that has been created using modeltime_table()

  2. A workflow that has been fit by fit.workflow() or

  3. A parsnip model that has been fit using fit.model_spec()

type

A test data set tibble containing future information (timestamps and actual values).

Details

-The results of calibration and plot are used to evaluate models

Examples

library(tidyverse)
library(lubridate)
library(timetk)
library(parsnip)
library(rsample)
library(modeltime)

# Data
data_prepared_tbl <- m4_monthly %>% filter(id == "M750")

# Split Data 80/20
splits <- initial_time_split(data_prepared_tbl, prop = 0.9)

# Model: auto_arima
model_fit_arima <- arima_reg() %>%
    set_engine(engine = "auto_arima") %>%
    fit(value ~ date, data = training(splits))

# Calibrate and plot
calibrate_and_plot(model_fit_arima, type="testing")

Jofou/jofou.lib documentation built on May 22, 2022, 11:42 a.m.