PPshapdependence {PPtreeregViz}R Documentation

Dependency plot

Description

Dependency plot using PPKernelSHAP

Usage

PPshapdependence(data_long, x, y=NULL, color_feature=NULL, smooth=TRUE)

Arguments

data_long

ppshapr_prep class object.

x

the independent variable to see

y

the interaction effect by putting the values of the independent variables in different colors.

color_feature

display other variables with color. Default value is NULL.

smooth

geom_smooth option. Default value is TRUE.

Details

Dependency plots are designed to show the effect of one independent variable on the model's prediction. Each point corresponds to each row of the training data, and the y axis corresponds the PPKernelSHAP value of the variable, indicating how much knowing the value of the variable changes the output of the model for the prediction of the data.

Value

An object of the class ggplot

Examples

data(dataXY)
testX <- dataXY[1,-1]
Model <- PPTreereg(Y~., data = dataXY, DEPTH = 2)
shap_long <- ppshapr_prep(Model, final.rule =5, method="simple")
PPshapdependence(shap_long,x = "X1")


[Package PPtreeregViz version 2.0.5 Index]