predict.model_unified | R Documentation |
Predict using unified_model representation.
## S3 method for class 'model_unified'
predict(object, x, ...)
object |
Unified model representation of the model created with a (model).unify function. |
x |
Observations to predict. A |
... |
other parameters |
a vector of predictions.
library(gbm)
data <- fifa20$data[colnames(fifa20$data) != 'work_rate']
data['value_eur'] <- fifa20$target
gbm_model <- gbm::gbm(
formula = value_eur ~ .,
data = data,
distribution = "laplace",
n.trees = 20,
interaction.depth = 4,
n.cores = 1)
unified <- gbm.unify(gbm_model, data)
predict(unified, data[2001:2005, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.