我正在使用Microsoft Azure Machine Learning的"studio (预览)“来创建一个管道,它将机器学习应用于连接到我们的数据仓库的blob存储中的数据集。
在“设计器”中,可以将"Exectue R Script“操作添加到管道中。我正在使用这个功能来执行我自己的一些机器学习算法。
我已经得到了这个脚本的“hello world”版本(包括使用"script bundle“加载我自己的R文件中的函数)。它应用了一个非常简单的操作(用date列中的日期和‘today’计算天数差),并将输出存储为新文件。假设导出的文件包含正确的信息,我知道R脚本工作得很好。
脚本如下所示:
# R version: 3.5.1
# The script MUST contain a function named azureml_main
# which is the entry point for this module.
# The entry point function can contain up to two input arguments:
# Param<medals>: a R DataFrame
# Param<matches>: a R DataFrame
azureml_main <- function(dataframe1, dataframe2){
message("STARTING R script run.")
# If a zip file is connected to the third input port, it is
# unzipped under "./Script Bundle". This directory is added
# to sys.path.
message('Adding functions as source...')
if (FALSE) {
# This works...
source("./Script Bundle/first_function_for_script_bundle.R")
} else {
# And this works as well!
message('Sourcing all available functions...')
functions_folder = './Script Bundle'
list.files(path = functions_folder)
list_of_R_functions <- list.files(path = functions_folder, pattern = "^.*[Rr]$", include.dirs = FALSE, full.names = TRUE)
for (fun in list_of_R_functions) {
message(sprintf('Sourcing <%s>...', fun))
source(fun)
}
}
message('Executing R pipeline...')
dataframe1 = calculate_days_difference(dataframe = dataframe1)
# Return datasets as a Named List
return(list(dataset1=dataframe1, dataset2=dataframe2))
}尽管我在R脚本中打印了一些消息,但我找不到应该包含这些打印消息的"stdoutlogs“和"stderrlogs”。
我需要打印的消息1)分析如何进行的信息和-most重要的- 2)调试的情况下代码失败。
现在,我(在多个位置)找到了文件"stdoutlogs.txt“和"stderrlogs.txt”。当我点击"Designer“中的"Exectue R Script”时,可以在"Logs“下找到这些脚本。我还可以在“实验”下找到"stdoutlogs.txt“和"stderrlogs.txt”文件,然后在“输出”选项卡和“日志”选项卡下单击完成的“运行”。然而..。所有这些文件都是空的。
谁能告诉我如何从我的R脚本打印消息,并帮助我找到打印信息的位置?
发布于 2020-01-24 09:38:29
你能点击“执行R模块”并下载70_driver.log吗?我尝试了消息(“正在启动R脚本运行。”)在R样本中,可以在那里找到输出。

https://stackoverflow.com/questions/59881727
复制相似问题