Learn R Programming

AzureML (version 0.1.1)

consumeDataframe: Use a web service to score a data frame

Description

Score a data frame, where each row is the input to the scoring function, using a Microsoft Azure Machine Learning web service

Usage

consumeDataframe(apiKey, requestUrl, scoreDataFrame,
  globalParam = setNames(list(), character(0)), batchSize = 300,
  retryDelay = 0.3)

Arguments

apiKey
primary access key of the web service as a string
requestUrl
API URL
scoreDataFrame
the data frame to be scored
globalParam
global parameters entered as a list, default value is an empty list
batchSize
batch size of each batch, default value is 300
retryDelay
the time in seconds to delay before retrying in case of a server error, default value is 0.3 seconds

Value

  • returnDataFrame data frame containing results returned from web service call

See Also

discoverSchema publishWebService Other consumption functions: consumeFile; consumeLists

Examples

Run this code
add <- function(x,y) { return(x+y) }
newService <- publishWebService("add", "add",
 list("x"="int","y"="int"), list("z"="int"), wsID, authToken)
webserviceDetails <- newService[[1]]
endpoints <- newService[[2]]

df <- data.frame("x"=c(1,2), "y"=c(3,4))
response <- consumeDataframe(endpoints[[1]]$PrimaryKey, endpoints[[1]]$ApiLocation, df)

Run the code above in your browser using DataLab