augment_lr: Augmented Output for Tidymodel's Linear Regression

Description Usage Arguments Value Examples

View source: R/sptidy.R

Description

Adds two columns to the original data of the scikit learn's linear regression model. This includes predictions and residuals.

Usage

1
augment_lr(my_lr, x, y)

Arguments

my_lr

the linear model to augment

x

the data frame containing the explanatory variables

y

the data frame containing the target variable

Value

output data.frame

Examples

1
2
3
4
5
6
7
# Import libraries
library(dplyr)
library(sptidy)
data("longley")
my_lr <- lm(Employed~., data = longley)
augment_lr(my_lr, (longley %>% select(!Employed)),
 as.data.frame(longley$Employed))

UBC-MDS/sptidy documentation built on March 23, 2021, 8:33 a.m.