来自 Azure 机器学习的错误请求响应
Bad Request Response from Azure Machine Learning
我在 Azure 机器学习中有一个需要两个输入的 R 脚本。从那以后,我一直致力于一个项目,该项目将利用我在 Azure 中创建的 Web 服务。当我使用整数作为值时,一切正常。在我的 C# 代码中,这些值仍然是双精度值,我使用 ToString 为 HTTP 请求格式化它们。我可以发送数据,并得到 100% 准确的结果。但是,当我发送实际包含小数点后数字的值时,我收到错误的请求响应。我认为问题出在 R 脚本如何从 Azure 机器学习输入中读取。到目前为止我有这个:
#R Script in Azure ML:
1: objCoFrame <- maml.mapInputPort(2) # class: data.frame
2: objCoVector <- as.vector(objCoFrame[1,])
这是用整数做的把戏。我也试过
2: objCoVector <- as.vector(as.numeric(objCoFrame[1,]))
但得到了相同的结果。
错误的请求响应内容如下:
{
"error":
{
"code":"BadArgument",
"message":"Invalid argument provided.",
"details":
[{
"code":"InputParseError",
"target":"rhsValues",
"message":"Parsing of input vector failed. Verify the input vector has the correct number of columns and data types. Additional details: Input string was not in a correct format.."
}]
}
}
你能在传递给 execute-R 之前使用 Meta-Editor 强制键入吗
我在 Azure 机器学习中有一个需要两个输入的 R 脚本。从那以后,我一直致力于一个项目,该项目将利用我在 Azure 中创建的 Web 服务。当我使用整数作为值时,一切正常。在我的 C# 代码中,这些值仍然是双精度值,我使用 ToString 为 HTTP 请求格式化它们。我可以发送数据,并得到 100% 准确的结果。但是,当我发送实际包含小数点后数字的值时,我收到错误的请求响应。我认为问题出在 R 脚本如何从 Azure 机器学习输入中读取。到目前为止我有这个:
#R Script in Azure ML:
1: objCoFrame <- maml.mapInputPort(2) # class: data.frame
2: objCoVector <- as.vector(objCoFrame[1,])
这是用整数做的把戏。我也试过
2: objCoVector <- as.vector(as.numeric(objCoFrame[1,]))
但得到了相同的结果。
错误的请求响应内容如下:
{
"error":
{
"code":"BadArgument",
"message":"Invalid argument provided.",
"details":
[{
"code":"InputParseError",
"target":"rhsValues",
"message":"Parsing of input vector failed. Verify the input vector has the correct number of columns and data types. Additional details: Input string was not in a correct format.."
}]
}
}
你能在传递给 execute-R 之前使用 Meta-Editor 强制键入吗