Description Usage Arguments Value Examples
Get proximity matrix of an ranger object
1 | proximityMatrixRanger(x, y = NULL, rf)
|
x |
a new dataset |
y |
a second new dataset (Default: NULL) |
rf |
|
a dist
or a matrix object with pairwise proximity of
observations in x vs y (if not null)
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
require(ranger)
rf <- ranger(Species ~ ., data = iris, num.trees = 5, write.forest = TRUE)
proximityMatrixRanger(x = iris[, -5], rf = rf)
set.seed(1234L)
learn <- sample(1:150, 100)
test <- (1:150)[-learn]
rf <- ranger(Species ~ ., data = iris[learn, ], num.trees = 5, write.forest = TRUE)
proximityMatrixRanger(x = iris[learn, -5], y = iris[test, -5], rf = rf)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.