We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ad5fa0 commit 7cdd98eCopy full SHA for 7cdd98e
1 file changed
R/unify_ranger.R
@@ -40,6 +40,10 @@ ranger.unify <- function(rf_model, data) {
40
n <- rf_model$num.trees
41
x <- lapply(1:n, function(tree) {
42
tree_data <- data.table::as.data.table(ranger::treeInfo(rf_model, tree = tree))
43
+ # Fix for probability forests
44
+ if (rf_model$treetype == "Probability estimation") {
45
+ data.table::setnames(tree_data, "pred.1", "prediction")
46
+ }
47
tree_data[, c("nodeID", "leftChild", "rightChild", "splitvarName", "splitval", "prediction")]
48
})
49
return(ranger_unify.common(x = x, n = n, data = data, feature_names = rf_model$forest$independent.variable.names))
0 commit comments