R/computeOOBWeights.R

Defines functions getOOBWeights

getOOBWeights <- function(forest) {
  misfit <- mapply(forest$forest,forest$forest.data, FUN= function(tree, data) {
    evaluateTree(tree=tree, test_set=data$oob.data,data_type = "raw")
  })
  weights <- 1/unlist(misfit[1,])
  weights <- weights / sum(weights)
  
  return(weights)
}
brandmaier/semtree documentation built on April 18, 2024, 3:24 a.m.