2
我在Azure機器學習中有一個R腳本,需要兩個輸入。自那時起我一直在研究一個項目,該項目將利用我在Azure中創建的Web服務。當我使用整數作爲值時,一切正常。在我的C#代碼中,這些值仍然是雙精度的,我使用ToString爲HTTP請求設置格式。我可以發送數據,並返回100%準確的結果。但是,當我發送實際包含小數點後的數字的值時,會收到錯誤的請求響應。我認爲問題在於R腳本如何從Azure機器學習輸入中讀取。到目前爲止,我有這樣的:來自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.."
}]
}
}