
gg_partial_list
object.randomForestSRC::rfsrc
response variable (y-axis) against
the covariate of interest (specified when creating the
gg_partial_list
object).## S3 method for class 'gg_partial_list':
plot(x, points = TRUE, smooth = "loess", ...)
gg_partial_list
object created from a gg_partial
forest objectggplot
objectIshwaran H. and Kogalur U.B. (2007). Random survival forests for R, Rnews, 7(2):25-31.
Ishwaran H. and Kogalur U.B. (2013). Random Forests for Survival, Regression and Classification (RF-SRC), R package version 1.4.
randomForestSRC::plot.variable
gg_partial
plot.gg_partial
gg_variable
plot.gg_variable
## ------------------------------------------------------------
## classification
## ------------------------------------------------------------
## iris "Petal.Width" partial dependence plot
##
# iris_rf <- rfsrc(Species ~., data = iris)
# iris_prtl <- plot.variable(iris_rf, xvar.names = "Petal.Width",
# partial=TRUE)
data(iris_prtl, package="ggRandomForests")
ggrf_obj <- gg_partial(iris_prtl)
plot(ggrf_obj)
## ------------------------------------------------------------
## regression
## ------------------------------------------------------------
## airquality "Wind" partial dependence plot
##
# airq_rf <- rfsrc(Ozone ~ ., data = airquality)
# airq_prtl <- plot.variable(airq_rf, xvar.names = "Wind",
# partial=TRUE, show.plot=FALSE)
data(airq_prtl, package="ggRandomForests")
ggrf_obj <- gg_partial(airq_prtl)
plot(ggrf_obj)
## ------------------------------------------------------------
## survival examples
## ------------------------------------------------------------
## survival "age" partial variable dependence plot
##
# data(veteran, package = "randomForestSRC")
# veteran_rf <- rfsrc(Surv(time,status)~., veteran, nsplit = 10, ntree = 100)
#
## 30 day partial plot for age
# veteran_prtl <- plot.variable(veteran_rf, surv.type = "surv",
# partial = TRUE, time=30,
# xvar.names = "age",
# show.plots=FALSE)
data(veteran_prtl, package="ggRandomForests")
ggrf_obj <- gg_partial(veteran_prtl)
plot(ggrf_obj)
Run the code above in your browser using DataLab