33 lines
1.1 KiB
R
33 lines
1.1 KiB
R
% Generated by roxygen2 (4.0.1): do not edit by hand
|
|
\docType{methods}
|
|
\name{predict,xgb.Booster-method}
|
|
\alias{predict,xgb.Booster-method}
|
|
\title{Predict method for eXtreme Gradient Boosting model}
|
|
\usage{
|
|
\S4method{predict}{xgb.Booster}(object, newdata, outputmargin = FALSE,
|
|
ntreelimit = NULL)
|
|
}
|
|
\arguments{
|
|
\item{object}{Object of class "xgb.Boost"}
|
|
|
|
\item{newdata}{takes \code{matrix}, \code{dgCMatrix}, local data file or
|
|
\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.}
|
|
|
|
\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.
|
|
}
|
|
\examples{
|
|
data(iris)
|
|
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
|
pred <- predict(bst, as.matrix(iris[,1:4]))
|
|
}
|
|
|