fix small bug introduced in refactoring
This commit is contained in:
parent
2154a160a3
commit
84fb89af70
@ -38,10 +38,9 @@ xgb.importance <- function(feature_names, filename_dump){
|
||||
treeDump <- function(feature_names, text){
|
||||
result <- c()
|
||||
for(line in text){
|
||||
m <- regexec("\\[f.*\\]", line)
|
||||
p <- regmatches(line, m)
|
||||
p <- regexec("\\[f.*\\]", line) %>% regmatches(line, .)
|
||||
if (length(p[[1]]) > 0) {
|
||||
splits <- sub("\\]", "", sub("\\[f", "", p[[1]])) %>% strsplit("<")[[1]] %>% as.numeric
|
||||
splits <- sub("\\[f", "", p[[1]]) %>% sub("\\]", "", .) %>% strsplit("<") %>% .[[1]] %>% as.numeric
|
||||
result <- c(result, feature_names[splits[1]+ 1])
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user