Merge pull request #668 from DexGroves/add-metadata

Expose model parameters to R
This commit is contained in:
Yuan (Terry) Tang
2015-12-16 15:55:54 -06:00
2 changed files with 37 additions and 0 deletions

View File

@@ -140,6 +140,7 @@ xgb.train <- function(params=list(), data, nrounds, watchlist = list(),
warning('watchlist is provided but verbose=0, no evaluation information will be printed')
}
fit.call <- match.call()
dot.params <- list(...)
nms.params <- names(params)
nms.dot.params <- names(dot.params)
@@ -224,9 +225,13 @@ xgb.train <- function(params=list(), data, nrounds, watchlist = list(),
}
}
bst <- xgb.Booster.check(bst)
if (!is.null(early.stop.round)) {
bst$bestScore <- bestScore
bst$bestInd <- bestInd
}
attr(bst, "call") <- fit.call
attr(bst, "params") <- params
return(bst)
}