This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @title Build GBM Tree | |
#' @description Create a `data.tree` object from a GBM tree. | |
#' @param gbm_model Object of class `gbm` | |
#' @param i.tree Tree iteration to build from | |
#' @return A `data.tree` object from the `i.tree` tree of `gbm_model`. | |
build_tree <- function(gbm_model, i.tree = 1) { | |
gbm_tree <- gbm::pretty.gbm.tree(gbm_model, i.tree = i.tree) | |
pathString <- c("0" = "0") | |
for (node in seq(1, nrow(gbm_tree) - 1)) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.