Learn R Programming

AzureML (version 0.1.1)

consumeFile: Use a web service to score a file

Description

Read in a csv and score it in batches using a Microsoft Azure Machine Learning Web Service. The results are stored in a new csv, default named "results.csv"

Usage

consumeFile(apiKey, requestUrl, inFileName, globalParam = setNames(list(),
  character(0)), outputFileName = "results.csv", batchSize = 300,
  retryDelay = 0.3)

Arguments

apiKey
primary access key as a string
requestUrl
API URL
inFileName
the name of the file to be scored as a string
globalParam
global parameters entered as a list, default value is an empty list
outputFileName
the name of the file to output results to, entered as a string, default value is "results.csv"
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: consumeDataframe; 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]]

response <- consumeFile(endpoints[[1]]$PrimaryKey, endpoints[[1]]$ApiLocation, "test.csv")

Run the code above in your browser using DataLab