View source: R/shapPPdependence.R
PPshapdependence | R Documentation |
Dependency plot using PPKernelSHAP
PPshapdependence(data_long, x, y=NULL, color_feature=NULL, smooth=TRUE)
data_long |
|
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. |
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.
An object of the class ggplot
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.