partialPlot: Partial dependence plot

Description Usage Arguments Details Value Author(s) References See Also

Description

Partial dependence plot gives a graphical depiction of the marginal effect of a variable on the response variable.

Usage

1
2
3
4
partialPlot(x, pred.data, x.var, offset,
w, plot = TRUE, n.pt = min(length(unique(pred.data[, xname])), 51),
rug = TRUE, xlab=deparse(substitute(x.var)), ylab="",
main=paste("Partial Dependence on", deparse(substitute(x.var))),...)

Arguments

x,

an object of class rfCountData, which contains a forest component.

pred.data,

a data frame used for contructing the plot, usually the training data used to contruct the random forest.

x.var,

name of the variable for which partial dependence is to be examined.

offset,

a vector, the corresponding log-exposures of pred.data.

w,

weights to be used in averaging; if not supplied, mean is not weighted

plot,

whether the plot should be shown on the graphic device.

n.pt,

if x.var is continuous, the number of points on the grid for evaluating partial dependence.

rug,

whether to draw hash marks at the bottom of the plot indicating the deciles of x.var.

xlab,

label for the x-axis.

ylab,

label for the y-axis.

main,

main title for the plot.

...,

other graphical parameters to be passed on to plot or lines.

Details

The function being plotted is defined as:

f(x) = 1/n* ∑_{i=1}^{n} f(x, x_{iC})

, where x is the variable for which partial dependence is sought, and x_iC is the other variables in the data.

Value

A list with two components: x and y, which are the values used in the plot. The rfCountData object must contain the forest component; i.e., created with rfPoisson(..., keep.forest=TRUE). This function runs quite slow for large data sets.

Author(s)

Andy Liaw andy_liaw@merck.com

References

Friedman, J. (2001). Greedy function approximation: the gradient boosting machine, Ann. of Stat.

See Also

rfPoisson


fpechon/rfCountData documentation built on Aug. 12, 2019, 11:16 a.m.