# NOT RUN {
## ------------------------------------------------------------
## boston housing example
## ------------------------------------------------------------
if (library("mlbench", logical.return = TRUE)) {
data(BostonHousing)
hv <- holdout.vimp(medv ~ ., BostonHousing)
print(hv)
}
## ------------------------------------------------------------
## iris example illustrating vtry
## ------------------------------------------------------------
print(100 * holdout.vimp(Species ~ ., iris))
print(100 * holdout.vimp(Species ~ ., iris, vtry=2))
## ------------------------------------------------------------
## example involving class imbalanced data
## illustrates the new RFQ classifier
## see the function "imbalanced" for more information about RFQ
## ------------------------------------------------------------
data(breast, package = "randomForestSRC")
breast <- na.omit(breast)
f <- as.formula(status ~ .)
hv <- holdout.vimp(f, breast, rfq=TRUE, perf.type="g.mean")
print(10 * hv)
## ------------------------------------------------------------
## multivariate regression analysis example
## ------------------------------------------------------------
print(holdout.vimp(cbind(mpg, cyl) ~., mtcars))
## ------------------------------------------------------------
## white wine classification example
## ------------------------------------------------------------
data(wine, package = "randomForestSRC")
wine$quality <- factor(wine$quality)
hv <- holdout.vimp(quality ~ ., wine, vtry = 5)
print(100 * hv)
## ------------------------------------------------------------
## pbc survival example
## ------------------------------------------------------------
data(pbc, package = "randomForestSRC")
hv <- holdout.vimp(Surv(days, status) ~ ., pbc, splitrule = "random")
print(100 * hv)
## ------------------------------------------------------------
## WIHS competing risk example
## ------------------------------------------------------------
data(wihs, package = "randomForestSRC")
hv <- holdout.vimp(Surv(time, status) ~ ., wihs, ntree = 1000)
print(100 * hv)
# }
Run the code above in your browser using DataLab