将数据帧传递给MS R Server模型操作 [英] Passing data frame to MS R Server model operationalisation
问题描述
我正在运行ML服务器,并且已部署了一项服务,希望该服务的输入之一是data.frame。
I am running ML server and I have a service deployed that expects one of its inputs to be a data.frame.
当我使用mrsdeploy与R连接到该API端点时,可以传递data.frame。我想使用json在prostman中做同样的事情。
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.
如何格式化我的json,让我们说出某人的特征输入(data.frame)?
How can I format my json for lets say an input (data.frame) of characteristics about someone?
我会假设它像
{
...
bio:{ age:23, height :12, eyeC: red}
}
I would assume its something like { ... "bio": { "age" : 23, "height" : 12, "eyeC" : "red" } }
我尝试了各种组合,但都找回了关于转换为data.frame的错误在R
I have tried a variety of combinations all getting back an error about converting to data.frame in R
推荐答案
中,您必须以列格式(而不是行)传递数据帧。即,如果您的数据如下所示:
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
然后API期望输入为
{
"foo": [1, 2, 3],
"bar": ["a", "b", "c"]
}
这篇关于将数据帧传递给MS R Server模型操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!