出现在列表中的特征是带有样本插补的模型的特征。
错误说:http2框架层。
library("RCurl")
library("rjson")
# Accept SSL certificates issued by public Certificate Authorities
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))
h = basicTextGatherer()
hdr = basicHeaderGatherer()
req = list(
Inputs = list(
"input1"= list(
list(
'CORRESPON' = "0",
'HORA' = "13",
'GRUPO' = "",
'dewPoint' = "40.53",
'precipType' = "NA",
'DIA_Semana' = "Jueves",
'DIA_mes' = "11",
'Municipio' = "Almeria",
'Total_Ambos' = "189880",
'Comunidad' = "Andalucia",
'Provincia' = "Almeria"
)
)
),
GlobalParameters = setNames(fromJSON('{}'), character(0))
)
body = enc2utf8(toJSON(req))
api_key = "set-your-api-key" # Replace this with the API key for the web service
authz_hdr = paste('Bearer', api_key, sep=' ')
h$reset()
curlPerform(url = "https://ussouthcentral.services.azureml.net/workspaces/cc79cb484e71444e8f7cbe8bc07fdc94/services/5790601c0f4a482d9e8a9f566359320f/execute?api-version=2.0&format=swagger",
httpheader=c('Content-Type' = "application/json", 'Authorization' = authz_hdr),
postfields=body,
writefunction = h$update,
headerfunction = hdr$update,
verbose = TRUE
)
headers = hdr$value()
httpStatus = headers["status"]
if (httpStatus >= 400)
{
print(paste("The request failed with status code:", httpStatus, sep=" "))
# Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure
print(headers)
}
print("Result:")
result = h$value()
print(fromJSON(result))
顺便说一句,我想知道,从R进行输入时是否有任何可能的方法来添加更多输入。我试图复制一个input2(如上面出现的input1)并传递矢量,但是没有尝试得到任何结果。