首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >连接脚本输出以提取性能

连接脚本输出以提取性能
EN

Stack Overflow用户
提问于 2016-05-16 15:25:25
回答 1查看 90关注 0票数 0

当我使用Execute Script操作符时,其中有一个输入弧,这个输入是ExampleSet类型的,我运行单行脚本return operator.getInput(ExampleSet.class),然后将输出连接到一个以ExampleSet作为输入的Extract Performance操作符,得到一个错误:Mandatory input missing at port Performance.example set

我的目标是通过Analyse soundness扩展附带的RapidProm操作符检查Petri网的可靠性,并根据该字符串是否匹配“有声”,将第一行的第一个属性接受并更改为0或1,这样我就可以使用Extract Performance并使用Average将其与其他性能相结合。

Execute Script进行此操作是否是正确的方法,如果是的话,应该如何修复此错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-16 14:54:01

Firstly:不要为错误Mandatory input missing at port Performance.example set操心--运行模型时会解决它的。

Secondly:它确实有点难看,它是检查模型正确性的操作符的输出,因为它是一个很长的字符串,它看起来像Woflan诊断的net "d1cf46bd-15a9-4801-9f02-946a8f125eaf“--这个网络是Woflan诊断的声音结尾。

您确实可以使用执行脚本来解决以下问题:)请参见下面的脚本!输出是一个示例集,如果模型是健全的,则返回1,否则返回0。此外,我喜欢使用一些日志操作符将其转换为一个对文档有用的好表。

代码语言:javascript
复制
ExampleSet input = operator.getInput(ExampleSet.class);

    for (Example example : input) {
    String uglyResult = example["att1"];
    String soundResult = "The net is sound";
    Boolean soundnessCheck = uglyResult.toLowerCase().contains(soundResult.toLowerCase());
    if (soundnessCheck){
        example["att1"] = "1"; //the net is sound :)
    } else {
        example["att1"] = "0"; //the net is not sound!
    }
}
return input;

还请参阅我创建的附加示例模型。RapidMiner设置

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37257529

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档