multi trees

This commit is contained in:
pommedeterresautee
2015-05-17 15:16:28 +02:00
parent 3104f1f806
commit 947afd7eac
2 changed files with 45 additions and 2 deletions

View File

@@ -96,13 +96,14 @@ xgb.model.dt.tree <- function(feature_names = NULL, filename_dump = NULL, model
allTrees <- data.table()
anynumber_regex<-"[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"
anynumber_regex <- "[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"
for(i in 1:n_round){
tree <- text[(position[i]+1):(position[i+1]-1)]
# avoid tree made of a leaf only (no split)
if(length(tree) <2) next
if(length(tree) < 2) next
treeID <- i-1