Merge branch 'master' of ssh://github.com/tqchen/xgboost
Conflicts: src/utils/omp.h
This commit is contained in:
commit
2f6a64e8fa
@ -12,7 +12,7 @@ setClass("xgb.Booster")
|
|||||||
#' untransformed margin value. In logistic regression, outputmargin=T will
|
#' untransformed margin value. In logistic regression, outputmargin=T will
|
||||||
#' output value before logistic transformation.
|
#' 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.
|
#' @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
|
#' @examples
|
||||||
#' data(iris)
|
#' data(iris)
|
||||||
#' bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
#' bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
||||||
@ -28,7 +28,7 @@ setMethod("predict", signature = "xgb.Booster",
|
|||||||
ntreelimit <- 0
|
ntreelimit <- 0
|
||||||
} else {
|
} else {
|
||||||
if (ntreelimit < 1){
|
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")
|
ret <- .Call("XGBoosterPredict_R", object, newdata, as.integer(outputmargin), as.integer(ntreelimit), PACKAGE = "xgboost")
|
||||||
|
|||||||
@ -4,7 +4,8 @@
|
|||||||
\alias{predict,xgb.Booster-method}
|
\alias{predict,xgb.Booster-method}
|
||||||
\title{Predict method for eXtreme Gradient Boosting model}
|
\title{Predict method for eXtreme Gradient Boosting model}
|
||||||
\usage{
|
\usage{
|
||||||
\S4method{predict}{xgb.Booster}(object, newdata, outputmargin = FALSE)
|
\S4method{predict}{xgb.Booster}(object, newdata, outputmargin = FALSE,
|
||||||
|
ntreelimit = NULL)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{object}{Object of class "xgb.Boost"}
|
\item{object}{Object of class "xgb.Boost"}
|
||||||
@ -13,9 +14,12 @@
|
|||||||
\code{xgb.DMatrix}.}
|
\code{xgb.DMatrix}.}
|
||||||
|
|
||||||
\item{outputmargin}{whether the prediction should be shown in the original
|
\item{outputmargin}{whether the prediction should be shown in the original
|
||||||
value of sum of functions, when outputmargin=TRUE, the prediction is
|
value of sum of functions, when outputmargin=TRUE, the prediction is
|
||||||
untransformed margin value. In logistic regression, outputmargin=T will
|
untransformed margin value. In logistic regression, outputmargin=T will
|
||||||
output value before logistic transformation.}
|
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{
|
\description{
|
||||||
Predicted values based on xgboost model object.
|
Predicted values based on xgboost model object.
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
#else
|
#else
|
||||||
#ifndef DISABLE_OPENMP
|
#ifndef DISABLE_OPENMP
|
||||||
// use pragma message instead of warning
|
// use pragma message instead of warning
|
||||||
#pragma message ("Warning: OpenMP is not available. XGBoost will be compiled with single thread mode. You may want to use compiler with OpenMP support to 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
|
#endif
|
||||||
inline int omp_get_thread_num() { return 0; }
|
inline int omp_get_thread_num() { return 0; }
|
||||||
inline int omp_get_num_threads() { return 1; }
|
inline int omp_get_num_threads() { return 1; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user