evimp: Estimate variable importances in an earth object

Description Usage Arguments Value Note See Also Examples

View source: R/evimp.R

Description

Estimate variable importances in an earth object

Usage

1
evimp(object, trim=TRUE, sqrt.=TRUE)

Arguments

object

An earth object.

trim

If TRUE (default), delete rows in the returned matrix for variables that don't appear in any subsets.

sqrt.

Default is TRUE, meaning take the sqrt of the GCV and RSS importances before normalizing to 0 to 100. Taking the square root gives a better indication of relative importances because the raw importances are calculated using a sum of squares. Use FALSE to not take the square root.

Value

This function returns a matrix showing the relative importances of the variables in the model. There is a row for each variable. The row name is the variable name, but with -unused appended if the variable does not appear in the final model.

The columns of the matrix are (not all of these are printed by print.evimp):

The rows are sorted on the nsubsets criterion. This means that values in the nsubsets column decrease as you go down the column (more accurately, they are non-increasing). The values in the gcv and rss columns are also non-increasing, except where the gcv or rss rank differs from the nsubsets ranking.

Note

There is a chapter on evimp in the earth package vignette “Notes on the earth package”.

Acknowledgment

Thanks to Max Kuhn for the original evimp code and for helpful discussions.

See Also

earth, plot.evimp

Examples

1
2
3
4
5
data(ozone1)
earth.mod <- earth(O3 ~ ., data=ozone1, degree=2)
ev <- evimp(earth.mod, trim=FALSE)
plot(ev)
print(ev)

Example output

Loading required package: Formula
Loading required package: plotmo
Loading required package: plotrix
Loading required package: TeachingDemos
         nsubsets   gcv    rss
temp           11 100.0  100.0
humidity        9  35.7   38.9
ibt             7  31.7   34.0
doy             7  31.7   34.0
ibh             6  33.5>  36.1>
dpg             6  27.5   29.8
vis             5  21.5   24.2
wind            2  10.5   12.7
vh              1   5.7    7.9

earth documentation built on Oct. 23, 2020, 5:08 p.m.

Related to evimp in earth...