yhat.deploy: Deploy a model to Yhat's servers

Description Usage Arguments Examples

View source: R/yhatR.R

Description

This function takes model.transform and model.predict and creates a model on Yhat's servers which can be called from any programming language via Yhat's REST API (see yhat.predict).

Usage

1
2
yhat.deploy(model_name, packages = c(), confirm = TRUE,
  custom_image = NULL)

Arguments

model_name

name of your model

packages

list of packages to install using apt-get

confirm

boolean indicating whether to prompt before deploying

custom_image

name of the image you'd like your model to use

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
yhat.config <- c(
 username = "your username",
 apikey = "your apikey",
 env = "http://sandbox.yhathq.com/"
)
iris$Sepal.Width_sq <- iris$Sepal.Width^2
fit <- glm(I(Species)=="virginica" ~ ., data=iris)

model.require <- function() {
 # require("randomForest")
}

model.transform <- function(df) {
 df$Sepal.Width_sq <- df$Sepal.Width^2
 df
}
model.predict <- function(df) {
 data.frame("prediction"=predict(fit, df, type="response"))
}
## Not run: 
yhat.deploy("irisModel")
yhat.deploy("irisModelCustomImage", custom_image="myImage:latest")

## End(Not run)

yhatr documentation built on May 30, 2017, 8:12 a.m.