ranger_proximity: random forest ranger proximity matrix

View source: R/ranger_proximity.R

ranger_proximityR Documentation

random forest ranger proximity matrix

Description

Calculates OOB proximities from ranger object

Usage

ranger_proximity(y, x, sparse = FALSE)

Arguments

y

A range object with keep.inbag = TRUE

x

Independent data used in model

sparse

(FALSE/TRUE) Output a sparse matrix

Value

An n x n matrix where position i, j gives the proportion of times observation i and j are in the same terminal node across all trees. If sparse = TRUE, object is a sparse matrix dsCMatrix class from the Matrix package

Author(s)

Jeffrey S. Evans <jeffrey_evans<at>tnc.org

Examples

library(ranger)
fit <- ranger(Species ~ ., iris, keep.inbag = TRUE)
p <- ranger_proximity(fit, iris[,-5]) 


jeffreyevans/rfUtilities documentation built on Nov. 12, 2023, 6:52 p.m.