C part export a model dump string

This commit is contained in:
El Potaeto
2015-01-08 23:47:00 +01:00
parent 3d0bbae2c2
commit 6fd8bbe71a
3 changed files with 14 additions and 12 deletions

View File

@@ -32,6 +32,8 @@ xgb.dump <- function(model, fname, fmap = "", with.stats=FALSE) {
if (typeof(fname) != "character") {
stop("xgb.dump: second argument must be type character")
}
.Call("XGBoosterDumpModel_R", model, fname, fmap, as.integer(with.stats), PACKAGE = "xgboost")
result <- .Call("XGBoosterDumpModel_R", model, fmap, as.integer(with.stats), PACKAGE = "xgboost")
writeLines(result, fname)
#unlist(str_split(a, "\n"))==""
return(TRUE)
}