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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.