Description Usage Arguments Value Examples
View source: R/MSE_Test_File.R
This method runs the variable importance procedure (MSE_Test
) on each variable in the data frame, marginally, with an available plot method.
1 2 3 4 |
X |
Data frame of covariates - the training data. |
y |
Response vector. Currently only numeric responses (regression) are supported. |
X.test |
Covariates of the test set with which the MSE is calculated. |
y.test |
Responses in the test set with which the MSE is calculated. |
base.learner |
One of |
single_forest |
Logical. If |
NTest |
If |
Nbtree |
How many trees should be used for each variable. Can either be a single number, or a vector of length |
verbose |
Logical. Should a progress tracker be output in the console? |
keep_forest |
Logical. Should the original random forest be returned? |
mtry |
The |
p |
Subsample size exponent, see |
... |
Additional arguments to be passed to |
Returns an object of S4 class permtestImp
with the following values
ImportanceTable |
A |
call |
The original call, as provided by |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | set.seed(367116)
N <- 1250
Nvar <- 5
name_vec <- paste("X", 1:(2*Nvar), sep = "")
# training data:
X <- data.frame(replicate(Nvar, runif(N)),
replicate(Nvar, cut(runif(N), 3,
labels = as.character(1:3))))
names(X) <- name_vec
## Example where response is unrelated to any features
pm.null <- permtestImp(X = X, y = rnorm(N),
single_forest = F, base.learner = "rtree",
mtry = 3, NTest = 100, Nbtree = 100, B = 1000,
p = .75, verbose = T)
## Plotting the Importance Output
plot(pm.null)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.