Learn R Programming

xgrove (version 0.1-15)

upsilon: Explainability

Description

Compute explainability given predicted data of the model and an explainer.

Usage

upsilon(porig, pexp)

Value

Numeric explainability upsilon.

Arguments

porig

An object of class xgrove.

pexp

Name of the measure to be plotted on the x-axis, either "trees", "rules", "upsilon" or "cor".

References

  • Szepannek, G. and Luebke, K.(2023): How much do we see? On the explainability of partial dependence plots for credit risk scoring, Argumenta Oeconomica 50, DOI: 10.15611/aoe.2023.1.07.

Examples

Run this code
library(randomForest)
library(pdp)
data(boston)
set.seed(42)
# Compute original model
rf <- randomForest(cmedv ~ ., data = boston)
data <- boston[,-3] # remove target variable
# Compute predictions
porig <- predict(rf, data)

# Compute surrogate grove
xg <- xgrove(rf, data)
pexp <- predict(xg$model, data, n.trees = 16)
upsilon(porig, pexp)

Run the code above in your browser using DataLab