Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 来自自定义模块的多个输出_R_Azure_Azure Machine Learning Studio - Fatal编程技术网

R 来自自定义模块的多个输出

R 来自自定义模块的多个输出,r,azure,azure-machine-learning-studio,R,Azure,Azure Machine Learning Studio,显示如何为Azure机器学习Studio编写自定义模块。有一段是关于从模块返回多个输出的。然而,按照说明,我只能在第一个输出端口的可视化中看到数据,而其他端口仍然是空的 这是我们的后续问题。我在那里接受了答案,因为我误解了我编写的自定义模块的结果——有些输出端口可能是空的,我匆忙地假设输出是正确的。然而,在RStudio中运行相同的代码确实会生成本应在ML Studio中返回的数据。此外,打印数据也很有效 最简单的例子: 模块ZIP文件中包含的源文件: 测试R foo <- functio

显示如何为Azure机器学习Studio编写自定义模块。有一段是关于从模块返回多个输出的。然而,按照说明,我只能在第一个输出端口的可视化中看到数据,而其他端口仍然是空的

这是我们的后续问题。我在那里接受了答案,因为我误解了我编写的自定义模块的结果——有些输出端口可能是空的,我匆忙地假设输出是正确的。然而,在RStudio中运行相同的代码确实会生成本应在ML Studio中返回的数据。此外,打印数据也很有效

最简单的例子:

模块ZIP文件中包含的源文件:

测试R

foo <- function() {
    require(data.table)
    out1 <- data.table(mtcars)
    out2 <- data.table(cars)

    print("out1:")
    print(head(out1))
    print("out2:")
    print(head(out2))

    return(list(out1, out2))
}
我认为我正确地遵循了文档中的说明。 以前有人遇到过这个问题吗?有什么已知的解决方案吗


任何帮助都将不胜感激

R输出桥接器需要一个数据帧,请尝试此操作,而不是data.table

out1 <- data.frame(mtcars)
out2 <- data.frame(cars)
[ModuleOutput] [1] "out1:"
[ModuleOutput] 
[ModuleOutput]     mpg cyl disp  hp drat    wt  qsec vs am gear carb
[ModuleOutput] 
[ModuleOutput] 1: 21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
[ModuleOutput] 
[ModuleOutput] 2: 21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
[ModuleOutput] 
[ModuleOutput] 3: 22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
[ModuleOutput] 
[ModuleOutput] 4: 21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
[ModuleOutput] 
[ModuleOutput] 5: 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
[ModuleOutput] 
[ModuleOutput] 6: 18.1   6  225 105 2.76 3.460 20.22  1  0    3    1
[ModuleOutput] 
[ModuleOutput] [1] "out2:"
[ModuleOutput] 
[ModuleOutput]    speed dist
[ModuleOutput] 
[ModuleOutput] 1:     4    2
[ModuleOutput] 
[ModuleOutput] 2:     4   10
[ModuleOutput] 
[ModuleOutput] 3:     7    4
[ModuleOutput] 
[ModuleOutput] 4:     7   22
[ModuleOutput] 
[ModuleOutput] 5:     8   16
[ModuleOutput] 
[ModuleOutput] 6:     9   10
out1 <- data.frame(mtcars)
out2 <- data.frame(cars)