Learn R Programming

ddeploy (version 1.0.4)

duke_predict: Predict using deployed model using REST API.

Description

Predict using deployed model using REST API.

Usage

duke_predict(auth_details, model_name, new_data, host_name = NULL)

Arguments

auth_details
authorization parameters (must be stored in list format: list(user_name='exampleusername',api_key='exampleapikey'))
model_name
the name of the deployed model for predictions.
new_data
new feature values for predictions.
host_name
optional parameter.

Value

On successful prediction, a character vector with model predictions. An error message is returned on failure.

See Also

duke_deploy for deploying a model or duke_list to display a list of all deployed models.

Examples

Run this code
duke_auth <- list(
user_name = "try_it",
api_key   = "db1542b66f16aba5768d8a19c27dec4facf9168a",
endpoint = "/api/v1.0"
)
example_data <- as.data.frame(cbind(gl(3,50),rnorm(150)));names(example_data) <- c("x","y")
duke_predict(auth_details=duke_auth,model_name="example_fit",example_data)

Run the code above in your browser using DataLab