当我使用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进行此操作是否是正确的方法,如果是的话,应该如何修复此错误?
发布于 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。此外,我喜欢使用一些日志操作符将其转换为一个对文档有用的好表。
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设置
https://stackoverflow.com/questions/37257529
复制相似问题