Learn R Programming

PPtreeregViz (version 2.0.5)

ppshapr_prep: Calculate PPKernelSHAP for all train data set

Description

All train data set to calculate PPKernelSHAP

Usage

ppshapr_prep(PPTreeregOBJ = NULL, final.rule = 5, method = "simple")

Value

ppshapr_prep class object

Arguments

PPTreeregOBJ

PPTreereg class object - a model to be explained

final.rule

final rule to assign numerical values in the final nodes. 1: mean value in the final nodes 2: median value in the final nodes 3: using optimal projection 4: using all independent variables 5: using several significant independent variables

method

simple or empirical method to calculate PPKernelSHAP

Examples

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

Run the code above in your browser using DataLab