Learn R Programming

rfUtilities (version 1.0-2)

rf.partial.ci: Random Forests regression partial dependency plot with confidence intervals

Description

Plots the partial dependency, and associated confidence intervals, of a random forests regression model

Usage

rf.partial.ci(m, x, yname, xname, lci = 0.25, uci = 0.75, delta = FALSE)

Arguments

m
randomForest regression object
x
data.frame or matrix of independent variables used to build model
yname
Name of the dependent variable
xname
Name of the independent variable for calculating partial dependence
lci
Percentile of predictions to plot as the lower bound.
uci
Percentile of predictions to plot as the upper bound.
delta
Plot change in prediction between the independent variable and simulated values (Default = NULL)

Value

  • recordedplot object to recall plot

Examples

Run this code
library(randomForest)
 data(airquality)
 airquality <- na.omit(airquality)
 rf.ozone <- randomForest(y=airquality[,"Ozone"], airquality[,2:ncol(airquality)])

 par(mfrow=c(2,2))
   for(i in c("Solar.R", "Wind", "Temp", "Day")){
     rf.partial.ci(m=rf.ozone, x=airquality, yname="Ozone", xname=i, delta=TRUE)
   }

Run the code above in your browser using DataLab