fix demo - wasn't working before
This commit is contained in:
Родитель
e0f4e3292b
Коммит
cb1b92e3b3
|
@ -3,8 +3,8 @@
|
|||
#####################################################################################################
|
||||
|
||||
# IMPORTANT: need to compile all of consume, discover, publish functions before running this demo
|
||||
setwd("C://Users/t-alewa/Documents/Azure-MachineLearning-ClientLibrary-R/demo")
|
||||
#setwd("C://Users/t-ritra/Github/Documents/Azure-MachineLearning-ClientLibrary-R/demo")
|
||||
# setwd("C://Users/t-alewa/Documents/Azure-MachineLearning-ClientLibrary-R/demo")
|
||||
setwd("C://Users/t-ritra/Documents/Github/Azure-MachineLearning-ClientLibrary-R/demo")
|
||||
|
||||
|
||||
# test server
|
||||
|
|
|
@ -100,7 +100,7 @@ consumeDataTable <- function(api_key, requestURL, columnNames, ..., globalParam=
|
|||
#make api call with components of payload
|
||||
results <- callDTAPI(api_key, requestURL, columnNames, valuesList, globalParam, retryDelay)
|
||||
results <- jsonlite::fromJSON(results)
|
||||
|
||||
|
||||
resultValues = results$Results$output1$value
|
||||
# Previous lines were commented out, would not return correctly if there were multiple return values
|
||||
#resultDF <- data.frame(resultList[,(ncol(resultList))])
|
||||
|
@ -187,15 +187,15 @@ consumeDataframe <- function(api_key, requestURL, valuesDF, globalParam=setNames
|
|||
resultStored <- jsonlite::fromJSON(temp)
|
||||
resultList = resultStored$Results$output1$value$Values
|
||||
resultDF <- data.frame(resultList[,(ncol(resultList))])
|
||||
# print(resultDF)
|
||||
# print(is.data.frame(resultDF))
|
||||
# print(resultDF)
|
||||
# print(is.data.frame(resultDF))
|
||||
if(length(df) != 0 && length(resultDF) != 0) {
|
||||
names(df) <- names(resultDF)
|
||||
}
|
||||
df <- rbind(df,resultDF)
|
||||
colnames(df) <- "Scored probabilities"
|
||||
|
||||
# print("passed")
|
||||
# print("passed")
|
||||
print(sprintf("%i %s %i %s", i,"out of",length(values),"processed"))
|
||||
valuebatch = list()
|
||||
counter = 0
|
||||
|
@ -204,10 +204,10 @@ consumeDataframe <- function(api_key, requestURL, valuesDF, globalParam=setNames
|
|||
}
|
||||
colnames(df) <- "Scored probabilities"
|
||||
return(df)
|
||||
# resultStored <- jsonlite::fromJSON(resultStored)
|
||||
# resultDF <- data.frame(matrix(resultStored$Results$output1$value$Values))
|
||||
# colnames(resultDF) <- resultStored$Results$output1$value$ColumnNames
|
||||
# return(resultDF)
|
||||
# resultStored <- jsonlite::fromJSON(resultStored)
|
||||
# resultDF <- data.frame(matrix(resultStored$Results$output1$value$Values))
|
||||
# colnames(resultDF) <- resultStored$Results$output1$value$ColumnNames
|
||||
# return(resultDF)
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче