View source: R/predict_model.R
predictModel | R Documentation |
This function enables to make predictions on the server for any model. Requirement is that it can be serialized and deserialized without loosing model components. Therefore, use 'check_serialization = TRUE'.
predictModel(
connections,
mod,
pred_name,
dat_name = "D",
predict_fun = "predict(mod, newdata = D)",
repush = FALSE,
check_serialization = TRUE,
package = NULL,
just_return_call = FALSE
)
connections |
('DSI::connection') Connection to an OPAL server. |
mod |
('arbitrary') R object containing a model which is used for predictions on the server. |
pred_name |
('character(1L)') Name of the object predictions should be assigned to. |
dat_name |
('character(1L)') Name of the data object on the server (default is '"D"'. |
predict_fun |
('character(1L)') The prediction function call as string. As placeholder use 'mod' for the model and 'D' for the data, e.g. 'predict(mod, newdata = D)'. This gives the possibility to call arbitrary predict function like ‘predict(mod, newdata = D, type = \"response\", family = binomial())’ for a GLM. The default is 'predict(mod, newdata = D)'. |
repush |
('logical(1L)') Logical value indicating if the model should again pushed to the server (default is 'TRUE'). |
check_serialization |
('logical(1L)') Check if the serialized model can be deserialized locally (default is 'TRUE'). |
package |
('character(1L)') Package required for model predictions (default is 'NULL'). |
just_return_call |
('logical(1L)') Just return the call and not execute on server (mainly for testing purposes, default is 'FALSE'). |
The prediction object returned from 'DSI::datashield.assign'
Daniel S.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.