plot.gradientForest: Plots for gradientForest objects

plot.gradientForestR Documentation

Plots for gradientForest objects

Description

Plot method for the gradientForest objects.

Usage

## S3 method for class 'gradientForest'
plot(x,	plot.type=c("Overall.Importance","Split.Density",
"Cumulative.Importance","Performance")[1], par.args=NULL, plot.args=NULL,...)

Arguments

x

an object of class gradientForest generated by gradientForest.

plot.type

specifies the type of plot defined for the object. Current choices for gradientForest objects are "Overall.Importance", "Split.Density", "Cumulative.Importance" and "Performance". Default "Overall.Importance".

par.args

a list object with arguments to be passed on to be used by par according the plot.type chosen. See Details for the defaults for each plot type.

plot.args

a list object with arguments to be passed on according the plot.type chosen. See Details for the defaults for each plot type.

...

further arguments passed to or from other methods. When plot.type is set to "Split.Density" or "Cumulative.Importance", the following two arguments are available:

imp.vars:

a character vector of names of predictor variables (currently limited to two variables). This vector required for the second and third plot types described below. Default (imp.vars=NULL) is to use the predictor variables that explain the two highest R^2 in the overall importance plot type.

imp.vars.names:

more descriptive names for the predictor variables to be used as labels on the plots. Default is set to predictor variable names given in imp.vars.

Details

The following are the default settings when par.args=NULL for each plot type. See par for the definition of each of the arguments.

Overall.Importance: list(mfrow = c(1, 2), mar = c(4, 6, 2, 1))

Split.Density: list(mar =c(4.5, 1.5, 0.5, 4.5), omi = c(0.1, 0.25, 0.1, 0.1)).

Cumulative.Importance: list(mar=c(0.0,2.1,1.1,0), omi=c(0.75, 0.75, 0.1, 0.1)). See plot.args below for the definitions for show.species and show.overall.

Performance: list(mfrow=c(1,1))

The following are the default settings when plot.args=NULL for each plot type.

Overall.Importance: list(cex.axis = 0.7, cex.names = cex.axis, las=1,horiz = TRUE)

Split.Density: list(leg.posn="topright",bin=FALSE, nbin=101, leg.panel=1, barwidth=1, cex.legend=0.8, line.ylab=1.5)

Cumulative.Importance: list(leg.posn="topleft",Legend=TRUE,common.scale=FALSE, line.ylab=1.0, cex.legend=0.75, show.species=TRUE,show.overall=TRUE,leg.nspecies=10), where leg.nspecies is set to the number of species in the legend (in order of importance) for cumulative importance plot. If common.scale is TRUE the scale of the y axis is the same for all panels. If show.species is TRUE the species cumulative curves are shown, and if show.overall the overall cumulative curves are shown.

Performance: list(horizontal = FALSE, show.names = FALSE, las=2,cex.axis = 0.7,cex.labels=0.7,line=2), where show.names is set to TRUE or FALSE to override the defaults on whether an x-axis label on the performance plot is printed for each group.

Value

The overall importance plot shows a simple barplot of the ranked importances of the physical variables. The most reliable importances are the R^2 weighted importances.

The split density plot shows the density of splits, the density of the data and the ratio of the densities for the the chosen physical variables.

The cumulative importance plot is an integrated form of the split density plot. The cumulative importance is plotted separately for all species and averaged over all species. The cumulative importance can be interpreted as a mapping from an environmental gradient on to biological gradient

The performance plot shows the goodness of fit performance measures for all species for which the physical variables have some predictive power. For regression, the measure is out-of-bag R^2. For classification, the measure is out-of-bag error rate.

Author(s)

N. Ellis, CSIRO, Cleveland, Australia. <Nick.Ellis@csiro.au>. S.J. Smith, DFO, Dartmouth, NS, Canada. <Stephen.Smith@dfo-mpo.gc.ca>

References

Breiman., L. (2001) Random Forests, Machine Learning, 45(1):5–32, 2001.

Ellis, N., Smith, S.J., and Pitcher, C.R. (2012) Gradient Forests: calculating importance gradients on physical predictors, Ecology, 93, 156–168.

Liaw, A. and Wiener, M. (2002) Classification and regression by randomforest, R News, 2(3): 18–22, URL http://CRAN.R-project.org/doc/Rnews/.

See Also

print.gradientForest

Examples

data(CoMLsimulation)
preds <- colnames(Xsimulation)
specs <- colnames(Ysimulation)
f1 <- gradientForest(data.frame(Ysimulation,Xsimulation), preds, specs[1:6], ntree=10)
plot(f1,plot.type="Overall.Importance")
plot(f1,plot.type="Split.Density")
plot(f1,plot.type="Cumulative.Importance")
plot(f1,plot.type="Performance")

gradientForest documentation built on Aug. 24, 2023, 3:03 p.m.