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

View source: R/rf.partial.ci.R

rf.partial.ciR Documentation

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 delta = NULL)

Value

recordedplot object to recall plot

Note

depends: randomForest

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Examples

 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) 
   } 


jeffreyevans/rfUtilities documentation built on Nov. 12, 2023, 6:52 p.m.