Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Azure by (5.8k points)

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:





        "message":"Invalid argument provided.",





            "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.."




1 Answer

0 votes
by (9.6k points)

Force the type using Meta-Editor before passing to execute-R and hat should do the work. 

Browse Categories