Explain.barp | R Documentation |
This function is implemented to calculate the contribution of each variable in the BARP (Bayesian Additive Regression Tree with post-stratification) model using the permutation method.
## S3 method for class 'barp'
Explain(
object,
feature_names = NULL,
X = NULL,
nsim = 1,
pred_wrapper = NULL,
census = NULL,
geo.unit = NULL,
parallel = FALSE,
...
)
object |
A BARP model (Bayesian Additive Regression Tree) estimated
using the |
feature_names |
The name of the variable for which you want to check the contribution.
The default value is set to |
X |
The dataset containing all independent variables used as input when estimating the BART model. The explanatory variables |
nsim |
The number of Monte Carlo sampling iterations, which is fixed at |
pred_wrapper |
A function used to estimate the predicted values of the model. |
census |
Census data containing the names of the |
geo.unit |
Enter the name of the stratification variable used in post stratification. |
parallel |
The default value is set to |
... |
Additional arguments to be passed |
Returns of class Explainbarp
with consisting of a list with the following components:
phis |
A list containing the Shapley values for each variable. |
newdata |
The data used to check the contribution of variables. If a variable has two categories, it is dummy-coded, and if it has three or more categories, categorical variables are one-hot encoded. |
fnull |
The expected value of the model's predictions. |
fx |
The prediction value for each observation. |
factor_names |
The name of the categorical variable. If the data contains only continuous or dummy variables, it is set to |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.