Learn R Programming

rerf (version 2.0.4)

StrCorr: Compute tree strength and correlation

Description

Computes estimates of tree strength and correlation according to the definitions in Breiman's 2001 Random Forests paper.

Usage

StrCorr(Yhats, Y)

Arguments

Yhats

predicted class labels for each tree in a forest.

Y

true class labels.

Value

scor

Examples

Run this code
# NOT RUN {
library(rerf)
trainIdx <- c(1:40, 51:90, 101:140)
X <- as.matrix(iris[, 1:4])
Y <- iris[[5]]
forest <- RerF(X[trainIdx, ], Y[trainIdx], num.cores = 1L)
predictions <- Predict(X[-trainIdx, ], forest, num.cores = 1L, aggregate.output = FALSE)
scor <- StrCorr(predictions, Y[-trainIdx])
# }

Run the code above in your browser using DataLab