Learn R Programming

auditor (version 1.3.5)

plotD3: Model Diagnostic Plots in D3 with r2d3 package.

Description

This function provides several diagnostic plots for regression and classification models. Provide object created with one of auditor's computational functions, model_residual, model_cooksdistance, model_evaluation, model_performance, model_evaluation.

Usage

plotD3(x, ...)

plotD3_auditor(x, ..., type = "residual")

# S3 method for auditor_model_residual plotD3(x, ..., type = "residual")

# S3 method for auditor_model_halfnormal plotD3(x, ..., type = "residual")

# S3 method for auditor_model_evaluation plotD3(x, ..., type = "residual")

# S3 method for auditor_model_cooksdistance plotD3(x, ..., type = "residual")

Arguments

x

object of class auditor_model_residual (created with model_residual function), auditor_model_performance (created with model_performance function), auditor_model_evaluation (created with model_evaluation function), auditor_model_cooksdistance (created with model_cooksdistance function), or auditor_model_halfnormal (created with model_halfnormal function).

...

other arguments dependent on the type of plot or additional objects of classes 'auditor_model_residual', 'auditor_model_performance', 'auditor_model_evaluation', 'auditor_model_cooksdistance', 'auditor_model_halfnormal'.

type

the type of plot. Single character. Possible values: 'acf', 'autocorrelation', 'cooksdistance', 'halfnormal','lift', 'prediction', 'rec', 'resiual', 'roc', 'rroc', 'scalelocation', (for detailed description see corresponding functions in see also section).

See Also

plotD3_acf, plotD3_autocorrelation, plotD3_cooksdistance, plotD3_halfnormal, plotD3_residual, plotD3_lift, plotD3_prediction, plotD3_rec, plotD3_roc, plotD3_rroc, plotD3_scalelocation

Examples

Run this code
dragons <- DALEX::dragons[1:100, ]

# fit a model
model_lm <- lm(life_length ~ ., data = dragons)

lm_audit <- audit(model_lm, data = dragons, y = dragons$life_length)

# validate a model with auditor
mr_lm <- model_residual(lm_audit)

# plot results
plotD3(mr_lm)
plotD3(mr_lm, type = "prediction")

hn_lm <- model_halfnormal(lm_audit)
plotD3(hn_lm)


Run the code above in your browser using DataLab