问题
I am running ML server and I have a service deployed that expects one of its inputs to be a data.frame.
When I connect with R to that API endpoint using mrsdeploy, I am able to pass a data.frame. I would like to do the same in prostman using json.
How can I format my json for lets say an input (data.frame) of characteristics about someone?
I would assume its something like { ... "bio": { "age" : 23, "height" : 12, "eyeC" : "red" } }
I have tried a variety of combinations all getting back an error about converting to data.frame in R
回答1:
You have to pass the data frame in column format, not rows. Ie, if your data looks like this:
foo bar
1 a
2 b
3 c
Then the API expects the input to be
{
"foo": [1, 2, 3],
"bar": ["a", "b", "c"]
}
回答2:
So when deploying a service, there should be a Swagger definition created for that service. Cannot you import that definition into Postman, and go from there?
Read here for more information.
来源:https://stackoverflow.com/questions/52544689/passing-data-frame-to-ms-r-server-model-operationalisation