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")
## ---------------------------------------------
Run the code above in your browser using DataLab