xgboost/R-package/R/predict.xgb.Booster.R
2014-08-27 15:03:24 -07:00

14 lines
370 B
R

#' @export
setClass("xgb.Booster")
#' @export
setMethod("predict", signature = "xgb.Booster",
definition = function(object, newdata, outputmargin = FALSE) {
if (class(newdata) != "xgb.DMatrix") {
newdata <- xgb.DMatrix(newdata)
}
ret <- .Call("XGBoosterPredict_R", object, newdata, as.integer(outputmargin), PACKAGE = "xgboost")
return(ret)
})