Description Usage Arguments Value Examples
xg_predict
use the previously trained xgboost model to perform
prediction on new data.
1 | xg_predict(model, data)
|
model |
Object A model object created by the function xg_train. |
data |
data.frame. A data.frame or data.table structure with column names equal to the input names. |
The prediction with the following fields:
pred: the prediction for the model.
proba: (optionnal) the associated probabilities for the prediction in case of a classification
1 2 3 4 5 6 7 | d <- xg_load_data(system.file("extdata", "titanic.csv", package = "ezXg"),
inputs = c("Pclass", "Sex", "Age", "SibSp",
"Parch", "Fare", "Embarked"),
output = "Survived",
train.size = 0.8)
md <- xg_train(d)
p <- xg_predict(md, d$data[train == FALSE])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.