Description Usage Arguments Value Methods References Examples
Compute the proximity matrix for a random forest, for the nnearest
most proximate examples to each training example.
1 2 3 | ## S4 method for signature 'bigcforest'
proximities(forest, nnearest=forest@nexamples,
cachepath=tempdir(), trace=0L)
|
forest |
A random forest of class |
nnearest |
The number of most proximate examples for which to compute proximity measures for each training example. Setting this to a smaller number will speed up computation of scaling co-ordinates. Default: |
cachepath |
Path to folder where the proximity matrix can be stored. If |
trace |
|
An object of class "bigrfprox"
containing the proximity matrix.
signature(forest = "bigcforest")
Compute the proximity matrix for a classification random forest.
Breiman, L. (2001). Random forests. Machine learning, 45(1), 5-32.
Breiman, L. & Cutler, A. (n.d.). Random Forests. Retrieved from http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 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 30 trees.
forest <- bigrfc(x, y, ntree=30L, varselect=vars, cachepath=NULL)
# Calculate proximity matrix.
prox <- proximities(forest, cachepath=NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.