importance.gradientForest: Importance of the variables in a 'gradientForest' or...

importance.gradientForestR Documentation

Importance of the variables in a gradientForest or combinedGradientForest object

Description

Compute the importance measures as a named vector

Usage

## S3 method for class 'gradientForest'
importance(x, type = c("Accuracy", "Impurity", "Weighted", "Raw", "Species")[3], 
sort = TRUE, ...)

Arguments

x

an object of class gradientForest, resulting from a call to gradientForest

type

the type of importance measure. For type="Species" the importance measure is the R^2 value for each species.

sort

if TRUE sort the result in decreasing order

...

further arguments for other methods

Value

a named vector of importance measures, one for each variable (or species), possibly sorted

Author(s)

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

Examples

data(CoMLsimulation)
preds <- colnames(Xsimulation)
specs <- colnames(Ysimulation)
f1 <- gradientForest(data.frame(Ysimulation,Xsimulation), preds, specs[1:6], ntree=10)
f2 <- gradientForest(data.frame(Ysimulation,Xsimulation), preds, specs[1:6+6], ntree=10)
f12 <- combinedGradientForest(west=f1,east=f2)
importance(f1)
importance(f1, "Species")
importance(f2, "Impurity")

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