update doc, resolve warnings

This commit is contained in:
hetong007
2015-02-09 17:48:52 -08:00
parent 47b5cf5148
commit 25f508e43e
4 changed files with 30 additions and 8 deletions

View File

@@ -17,12 +17,12 @@
#' pred <- predict(bst, test$data)
#' @export
#'
xgb.save.raw <- function(handle) {
if (class(handle) == "xgb.Booster"){
handle <- handle$handle
xgb.save.raw <- function(model) {
if (class(model) == "xgb.Booster"){
model <- model$handle
}
if (class(handle) == "xgb.Booster.handle") {
raw <- .Call("XGBoosterModelToRaw_R", handle, PACKAGE = "xgboost")
if (class(model) == "xgb.Booster.handle") {
raw <- .Call("XGBoosterModelToRaw_R", model, PACKAGE = "xgboost")
return(raw)
}
stop("xgb.raw: the input must be xgb.Booster.handle. Use xgb.DMatrix.save to save