## Examples from RFSRC package...
## ------------------------------------------------------------
## classification example
## ------------------------------------------------------------
## ------------- iris data
## You can build a randomForest
# rfsrc_iris <- rfsrc(Species ~ ., data = iris)
# ... or load a cached randomForestSRC object
data(rfsrc_iris, package="ggRandomForests")
# Get a data.frame containing error rates
gg_dta<- gg_error(rfsrc_iris)
# Plot the gg_error object
plot(gg_dta)
## RandomForest example
rf_iris <- randomForest::randomForest(Species ~ ., data = iris)
gg_dta <- gg_error(rf_iris)
plot(gg_dta)
gg_dta <- gg_error(rf_iris, training=TRUE)
plot(gg_dta)
## ------------------------------------------------------------
## Regression example
## ------------------------------------------------------------
if (FALSE) {
## ------------- airq data
rfsrc_airq <- rfsrc(Ozone ~ ., data = airquality, na.action = "na.impute")
# Get a data.frame containing error rates
gg_dta<- gg_error(rfsrc_airq)
# Plot the gg_error object
plot(gg_dta)
}
## ------------- Boston data
data(rfsrc_boston, package="ggRandomForests")
# Get a data.frame containing error rates
gg_dta<- gg_error(rfsrc_boston)
# Plot the gg_error object
plot(gg_dta)
if (FALSE) {
## ------------- mtcars data
# Get a data.frame containing error rates
gg_dta<- gg_error(rfsrc_mtcars)
# Plot the gg_error object
plot(gg_dta)
}
## ------------------------------------------------------------
## Survival example
## ------------------------------------------------------------
if (FALSE) {
## ------------- veteran data
## randomized trial of two treatment regimens for lung cancer
data(veteran, package = "randomForestSRC")
rfsrc_veteran <- rfsrc(Surv(time, status) ~ ., data = dta$veteran, ...)
gg_dta <- gg_error(rfsrc_veteran)
plot(gg_dta)
## ------------- pbc data
# Load a cached randomForestSRC object
data(rfsrc_pbc, package="ggRandomForests")
gg_dta <- gg_error(rfsrc_pbc)
plot(gg_dta)
}
Run the code above in your browser using DataLab