Steph Locke
2017-04-20
Take analysis to production
Code that does stuff!
Shiny is the interactive dashboard system
Rserve is an API system for R that allows access to an R environment
rApache is an apache module that serves the results of R scripts
DeployR is an API system for accessing R and R scripts
deployr.revolutionanalytics.com
AzureML is a GUI analysis system that can transform your model to a web service
AzureML
package to publish codelibrary("AzureML")
MLID<-"16ed88890b0644239ea800a90063bc0f"
AuthToken<-"e1e2d4f99b0041269c6435c0c6ccb07d"
myLM<-lm(data = iris,
Sepal.Length~Sepal.Width,
model = FALSE)
adhocPred<-predict(myLM,
newdata = data.frame(
Sepal.Width=5.7)
)
adhocPred
myPrediction<-function(SW=0){
# You would store coeficients
# In place of modelling every time!
myCoefsLM<-coef(lm(data = iris,
Sepal.Length~Sepal.Width,
model = FALSE))
myCoefScores<-crossprod(myCoefsLM,c(1,SW))
return(sum(myCoefScores))
}
response <- publishWebService(
"myPrediction",
"myPredictionOnline",
list("SW"="float"),
list("r"="float"),
MLID, AuthToken)
webservices <- getWebServices(MLID, AuthToken)
endpoints <- getEndpoints(MLID,
AuthToken,
webservices[[1]]$Id)
response <- consumeLists(
endpoints[[1]]$PrimaryKey,
endpoints[[1]]$ApiLocation,
list("SW"=9))
response