View source: R/05_predicted_forest_distance.R
predicted_forest_distance | R Documentation |
Computes dissimilarity matrix over the forest. Note that this function will parallelize the pairwise computations of the distances between the nodes on the available CPUs.
predicted_forest_distance(predictions, forest, init_dist = 0)
predictions |
[ |
forest |
[ |
init_dist |
[ |
[matrix
] Matrix of dissimilarities over the forest
Cesaire J. K. Fouodo
## Not run: set.seed(1234) train.idx <- sample(nrow(iris), 2/3 * nrow(iris)) iris.train <- iris[train.idx, ] iris.test <- iris[-train.idx, ] rg.iris <- ranger(Species ~ ., data = iris.train) pred.iris <- predict(rg.iris, data = iris.test, type = "terminalNodes") iris_dist <- predicted_forest_distance( forest = rg.iris, predictions = pred.iris) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.