From 025ca170ec02c2796154beb0653e83dbcb183131 Mon Sep 17 00:00:00 2001 From: Tong He Date: Mon, 1 Sep 2014 15:25:16 -0700 Subject: [PATCH 1/4] Update predict.xgb.Booster.R --- R-package/R/predict.xgb.Booster.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R-package/R/predict.xgb.Booster.R b/R-package/R/predict.xgb.Booster.R index 87666a55f..d42766f87 100644 --- a/R-package/R/predict.xgb.Booster.R +++ b/R-package/R/predict.xgb.Booster.R @@ -28,7 +28,7 @@ setMethod("predict", signature = "xgb.Booster", ntreelimit <- 0 } else { if (ntreelimit < 1){ - stop("predict: ntreelimit must be greater equal than 1") + stop("predict: ntreelimit must be equal to or greater than 1") } } ret <- .Call("XGBoosterPredict_R", object, newdata, as.integer(outputmargin), as.integer(ntreelimit), PACKAGE = "xgboost") From b973a4dcaa9e8701fbe61f2f07cb85e2a548b5e3 Mon Sep 17 00:00:00 2001 From: hetong Date: Mon, 1 Sep 2014 15:38:29 -0700 Subject: [PATCH 2/4] improve doc in predict --- R-package/R/predict.xgb.Booster.R | 2 +- R-package/man/predict-xgb.Booster-method.Rd | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/R-package/R/predict.xgb.Booster.R b/R-package/R/predict.xgb.Booster.R index d42766f87..390ac689e 100644 --- a/R-package/R/predict.xgb.Booster.R +++ b/R-package/R/predict.xgb.Booster.R @@ -12,7 +12,7 @@ setClass("xgb.Booster") #' untransformed margin value. In logistic regression, outputmargin=T will #' output value before logistic transformation. #' @param ntreelimit limit number of trees used in prediction, this parameter is only valid for gbtree, but not for gblinear. -#' set it to be value bigger than 0 +#' set it to be value bigger than 0. It will use all trees by default. #' @examples #' data(iris) #' bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2) diff --git a/R-package/man/predict-xgb.Booster-method.Rd b/R-package/man/predict-xgb.Booster-method.Rd index d43fd7362..d192997d2 100644 --- a/R-package/man/predict-xgb.Booster-method.Rd +++ b/R-package/man/predict-xgb.Booster-method.Rd @@ -4,7 +4,8 @@ \alias{predict,xgb.Booster-method} \title{Predict method for eXtreme Gradient Boosting model} \usage{ -\S4method{predict}{xgb.Booster}(object, newdata, outputmargin = FALSE) +\S4method{predict}{xgb.Booster}(object, newdata, outputmargin = FALSE, + ntreelimit = NULL) } \arguments{ \item{object}{Object of class "xgb.Boost"} @@ -13,9 +14,12 @@ \code{xgb.DMatrix}.} \item{outputmargin}{whether the prediction should be shown in the original - value of sum of functions, when outputmargin=TRUE, the prediction is - untransformed margin value. In logistic regression, outputmargin=T will - output value before logistic transformation.} +value of sum of functions, when outputmargin=TRUE, the prediction is +untransformed margin value. In logistic regression, outputmargin=T will +output value before logistic transformation.} + +\item{ntreelimit}{limit number of trees used in prediction, this parameter is only valid for gbtree, but not for gblinear. +set it to be value bigger than 0. It will use all trees by default.} } \description{ Predicted values based on xgboost model object. From ada9dd94ad2895c2394453164342abb249a74aff Mon Sep 17 00:00:00 2001 From: Tong He Date: Mon, 1 Sep 2014 15:51:48 -0700 Subject: [PATCH 3/4] Update omp.h --- src/utils/omp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/omp.h b/src/utils/omp.h index 73dcf6449..615dbdf51 100644 --- a/src/utils/omp.h +++ b/src/utils/omp.h @@ -10,7 +10,7 @@ #else #ifndef DISABLE_OPENMP // use pragma message instead of warning -#pragma message ("Warning: OpenMP is not available, xgboost will be compiled into single thread code. You may want to ungrade your compiler to enable OpenMP support, to get benefit of multi-threading.") +#pragma message ("Warning: OpenMP is not available, xgboost will be compiled into single-thread code. Downgrade your compiler to enable OpenMP support and get benefit of multi-threading.") #endif inline int omp_get_thread_num() { return 0; } inline int omp_get_num_threads() { return 1; } From d391becb4e2a714cce3ee626f9a37cf0d16212d3 Mon Sep 17 00:00:00 2001 From: Tong He Date: Mon, 1 Sep 2014 16:16:06 -0700 Subject: [PATCH 4/4] Update omp.h --- src/utils/omp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/omp.h b/src/utils/omp.h index 615dbdf51..5eb5612e0 100644 --- a/src/utils/omp.h +++ b/src/utils/omp.h @@ -10,7 +10,7 @@ #else #ifndef DISABLE_OPENMP // use pragma message instead of warning -#pragma message ("Warning: OpenMP is not available, xgboost will be compiled into single-thread code. Downgrade your compiler to enable OpenMP support and get benefit of multi-threading.") +#pragma message ("Warning: OpenMP is not available, xgboost will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading") #endif inline int omp_get_thread_num() { return 0; } inline int omp_get_num_threads() { return 1; }