viz_residuals: Residual plot of model

Description Usage Arguments Value Examples

View source: R/viz_residuals.R

Description

Residual plot of model

Usage

1
viz_residuals(fit, new_data)

Arguments

fit

a parsnip model object

new_data

A data frame or matrix.

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(parsnip)
reg <- linear_reg() %>%
  set_engine("lm") %>%
  set_mode("regression") %>%
  fit(mpg ~ ., data = mtcars)

viz_residuals(reg, mtcars)

linear_reg() %>%
  set_engine("lm") %>%
  set_mode("regression") %>%
  fit(mpg ~ ., data = mtcars) %>%
  viz_residuals(mtcars)

EmilHvitfeldt/horus documentation built on June 12, 2021, 7 p.m.