Created
November 24, 2015 08:33
-
-
Save bart6114/f7c90a1916e0a75417f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpg_fit<- | |
readRDS("mpg_fit.Rdata") | |
predict_mpg<-function(disp, wt, hp){ | |
new_data<-data.frame(disp=as.numeric(disp), | |
wt=as.numeric(wt), | |
hp=as.numeric(hp)) | |
predict(mpg_fit, newdata = new_data) | |
} | |
library(jug) | |
jug() %>% | |
post("/mpg_api", decorate(predict_mpg)) %>% | |
simple_error_handler() %>% | |
serve_it() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment