xgboost (version 0.3-0)

predict,xgb.Booster-method: Predict method for eXtreme Gradient Boosting model

Description

Predicted values based on xgboost model object.

Usage

## S3 method for class 'xgb.Booster':
predict(object, newdata, outputmargin = FALSE)

Arguments

object
Object of class "xgb.Boost"
newdata
takes matrix, dgCMatrix, local data file or xgb.DMatrix.
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.

Examples

Run this code
data(iris)
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
pred <- predict(bst, as.matrix(iris[,1:4]))

Run the code above in your browser using DataCamp Workspace