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)
}

Try the semtree package in your browser

Any scripts or data that you put into this service are public.

semtree documentation built on Nov. 26, 2023, 5:07 p.m.