check_residuals: Automated tests for model residuals

View source: R/check_residuals.R

check_residualsR Documentation

Automated tests for model residuals

Description

Currently three tests are performed - for outliers in residuals - for autocorrelation in target variable or in residuals - for trend in residuals as a function of target variable (detection of bias)

Usage

check_residuals(object, ...)

Arguments

object

An object of class 'explainer' created with function explain from the DALEX package.

...

other parameters that will be passed to further functions.

Value

list with statistics for particular checks

Examples

dragons <- DALEX::dragons[1:100, ]
lm_model <- lm(life_length ~ ., data = dragons)
lm_audit <- audit(lm_model, data = dragons, y = dragons$life_length)
check_residuals(lm_audit)
 ## Not run: 
 library("randomForest")
 rf_model <- randomForest(life_length ~ ., data = dragons)
 rf_audit <- audit(rf_model, data = dragons, y = dragons$life_length)
 check_residuals(rf_audit)

## End(Not run)

auditor documentation built on Nov. 2, 2023, 6:13 p.m.