Daric
Daric

Reputation: 480

Bad Request Response from Azure Machine Learning

I have an R script in Azure Machine Learning that takes two inputs. I have since been working on a project that will take advantage of the webservice I created within Azure. When I use whole numbers as the values, everything works fine. In my C# code, these values are still doubles, and I use ToString to format them for the HTTP request. I can send the data, and get 100% accurate results back. However, when I send values that actually contain digits after the decimal, I get a bad request response. I think the issue is with how the R script reads in from Azure Machine Learning inputs. So far I have this:

#R Script in Azure ML:
1:    objCoFrame <- maml.mapInputPort(2) # class: data.frame
2:    objCoVector <- as.vector(objCoFrame[1,])

which was doing the trick with integers. I have also tried

2:    objCoVector <- as.vector(as.numeric(objCoFrame[1,]))

but got the same result.

The Bad Request Response Content reads:

{
    "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.."
        }]
    }
}

Upvotes: 2

Views: 771

Answers (1)

neerajkh
neerajkh

Reputation: 1251

Can you force the type using Meta-Editor before passing to execute-R

Upvotes: 2

Related Questions