Description Usage Arguments Details Value Author(s) Examples
Variable importance in subgroup identification for predictive variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | MrSImp(
dataframe,
role,
B = 100,
bestK = 1,
maxDepth = 5,
minTrt = 5,
minData = max(c(minTrt * maxDepth, NROW(Y)/20)),
batchNum = 1L,
faster = FALSE,
display = FALSE,
treeName = paste0("tree_", format(Sys.time(), "%m%d"), ".yaml"),
nodeName = paste0("node_", format(Sys.time(), "%m%d"), ".txt"),
impName = paste0("imp_", format(Sys.time(), "%m%d"), ".txt")
)
|
dataframe |
train data frame |
role |
role follows GUIDE role |
B |
bootstrap number default = 100 |
bestK |
number of covariates in the regression model |
maxDepth |
maximum tree depth |
minTrt |
minimum treatment and placebo sample in each node |
minData |
minimum sample in each node |
batchNum |
related with exhaustive search for numerical split variable |
faster |
related with tree split searching |
display |
Whether display tree in the end |
treeName |
yaml file for save the tree |
nodeName |
file same for each node |
impName |
important variable file name |
MrSGUIDE variable importance
A list contains importance score variable names and roles
imp |
Importance score data frame |
role |
Role for each variable |
Settings |
Settings used to build the tree |
Peigen Zhou
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(MrSGUIDE)
set.seed(1234)
N = 200
np = 3
numX <- matrix(rnorm(N * np), N, np) ## numerical features
gender <- sample(c('Male', 'Female'), N, replace = TRUE)
country <- sample(c('US', 'UK', 'China', 'Japan'), N, replace = TRUE)
z <- sample(c(0, 1), N, replace = TRUE) # Binary treatment assignment
y1 <- numX[, 1] + 1 * z * (gender == 'Female') + rnorm(N)
y2 <- numX[, 2] + 2 * z * (gender == 'Female') + rnorm(N)
train <- data.frame(numX, gender, country, z, y1, y2)
role <- c(rep('n', 3), 'c', 'c', 'r', 'd', 'd')
mrsobj <- MrSImp(dataframe = train, role = role, B = 10)
mrsobj$imp
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.