nnearest
most proximate examples to each training example.
"proximities"(forest, nnearest=forest@nexamples, cachepath=tempdir(), trace=0L)
"bigcforest"
.forest@nexamples
.NULL
, then the big.matrix
's will be created in memory with no disk caching, which would be suitable for small data sets. If the user wishes to reuse the cached files, it is suggested that a folder other than tempdir()
is used, as the operating system may automatically delete any cache files in tempdir()
. Default: tempdir()
.0
for no verbose output. 1
to print verbose output. 2
to print even more verbose output on processing of each tree and example. Default: 0
."bigrfprox"
containing the proximity matrix.
signature(forest = "bigcforest")
Breiman, L. & Cutler, A. (n.d.). Random Forests. Retrieved from http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm.
# Classify cars in the Cars93 data set by type (Compact, Large,
# Midsize, Small, Sporty, or Van).
# Load data.
data(Cars93, package="MASS")
x <- Cars93
y <- Cars93$Type
# Select variables with which to train model.
vars <- c(4:22)
# Run model, grow 50 trees.
forest <- bigrfc(x, y, ntree=50L, varselect=vars, cachepath=NULL)
# Calculate proximity matrix.
prox <- proximities(forest, cachepath=NULL)
Run the code above in your browser using DataLab