CRAN_Status_Badge Total Downloads Build Status Coverage Status Binder Tweet

auditor’s pipeline: model %>% audit() %>% plot(type=…)

Installation

and from CRAN

install.packages("auditor")

DEMO

Run the code below or try the auditor by the online jupyter-notebook: Binder

library(auditor)
library(randomForest)
data(mtcars)

# fitting models
model_lm <- lm(mpg ~ ., data = mtcars)
set.seed(123)
model_rf <- randomForest(mpg ~ ., data = mtcars)

# creating a modelAudit object which contains all necessary components required for further processing
au_lm <- audit(model_lm)
au_rf <- audit(model_rf, label = "rf")

# generating plots
plot(au_lm, type = "Residual")
plot(au_lm, au_rf, type = "Residual")

plot(au_lm, au_rf, variable = "wt", type = "Prediction")

plot(au_lm, au_rf, type = "ModelCorrelation")
plot(au_lm, au_rf, variable = "wt", type = "ModelCorrelation")

# plots above are availible also via plotResidual(), plotPrediction() and plotModelCorrelation() functions

For more plot types and examples see A Short Overview of Plots section below.

Cheatsheets

A Short Overview of Plots

Plot name Function Regression Classification Examples
Autocorrelation Function plotACF() plot(..., type = "ACF") yes yes Examples
Autocorrelation plotAutocorrelation() plot(..., type = "Autocorrelation") yes yes Examples
Influence of observations plotCooksDistance() plot(..., type = "CooksDistance") yes yes Examples
Half-Normal plotHalfNormal() plot(..., type = "HalfNormal") yes yes Examples
LIFT Chart plotLIFT() plot(..., type = "LIFT") no yes Examples
Model Correlation plotModelCorrelation() plot(..., type = "ModelCorrelation") yes yes Examples
Principal Component Analysis of models plotModelPCA() plot(..., type = "ModelPCA") yes yes Examples
Model Ranking Plot plotModelRanking() plot(..., type = "ModelRanking") yes yes Examples
Predicted Response vs Observed or Variable Values plotPrediction() plot(..., type = "Prediction") yes yes Examples
Regression Error Characteristic Curves (REC) plotREC() plot(..., type = "REC") yes yes Examples
Plot Residuals vs Observed, Fitted or Variable Values plotResidual() plot(..., type = "Residual") yes yes Examples
Residual Boxplot plotResidualBoxplot() plot(..., type = "ResidualBoxplot") yes yes Examples
Residual Density plotResidualDensity() plot(..., type = "ResidualDensity") yes yes Examples
Receiver Operating Characteristic (ROC) plotROC() plot(..., type = "ROC") no yes Examples
Regression Receiver Operating Characteristic (RROC) plotRROC() plot(..., type = "RROC") yes yes Examples
Scale-Location plot plotScaleLocation() plot(..., type = "ScaleLocation") yes yes Examples
Two-sided Cumulative Distribution Function plotTwoSidedECDF() plot(..., type = "TwoSidedECDF") yes yes Examples

Acknowledgments

Work on this package was financially supported by the ‘NCN Opus grant 2016/21/B/ST6/02176’.