cumimp.gradientForest: Cumulative Importance of predictors for a 'gradientForest'...

Description Usage Arguments Value Author(s) See Also Examples

Description

Provide access to cumulative importance curves for a predictor. It is a generic function.

Usage

1
2
3
4
cumimp(x, ...)
## S3 method for class 'gradientForest'
cumimp(x, predictor, type = c("Overall", "Species")[1], 
standardize=TRUE, standardize_after=FALSE, ...)

Arguments

x

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

predictor

the name of the predictor

type

indicates the level of detail of the cumulative importance. The choices are

  • Overall: a single overall cumulative importance sequence is returned

  • Species: a cumulative importance sequence is returned for each species

standardize

logical, if TRUE then importances are standardized by density

standardize_after

logical, if TRUE then standardization, if applied, occurs after R^2 normalization. Default FALSE

...

further arguments for other methods

Value

If type is "Overall", a single list with components x and y, where x is the predictor values and y is the cumulative importance. If type is "Species", a list of such lists, one for each species.

Author(s)

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

See Also

cumimp.combinedGradientForest,importance.gradientForest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data(CoMLsimulation)
preds <- colnames(Xsimulation)
specs <- colnames(Ysimulation)
f1 <- gradientForest(data.frame(Ysimulation,Xsimulation), preds, specs[1:3], ntree=10)
par(mfrow=c(2,2))
cu.sp <- cumimp(f1, "A", "Species")
for (sp in names(cu.sp)) 
  plot(cu.sp[[sp]],main=sp,xlab="A",ylab="Cumulative Importance")
plot(cumimp(f1, "A", "Overall"),main="Overall")

# Demonstrate differences between standardization before and after normalization
par(mfrow=c(2,1))
plot(density(f1,"A"),main="Density of predictor 'A'",xlab='A')
rug(sample(density(f1,"A")$x,100))

plot(cumimp(f1,"A",standardize=FALSE),type='n',main="",ylab="Cum. importance",xlab='A')
lines(cumimp(f1,"A"),type='l',col="black")
lines(cumimp(f1,"A",standardize_after=TRUE),type='l',col="blue")
lines(cumimp(f1,"A",standardize=FALSE),type='l',col="red")
legend(par("usr")[1],par("usr")[4],legend=c("Standardize then Normalize (default)",
"Normalize then Standardize","Normalize only"),col=c("black","blue","red"),lty=1,cex=0.8)

slarge/gradientForest documentation built on May 3, 2019, 4:05 p.m.