在Rapidminer中存在重新命令吗?

时间:2017-05-05 19:06:51

标签: r rapidminer

如何更改标签属性中因子级别的顺序?我想实现这个R命令:

(Label<- relevel(Label, ref = "Yes")

我该怎么做?

1 个答案:

答案 0 :(得分:1)

您可以使用<?xml version="1.0" encoding="UTF-8"?><process version="7.2.003"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="7.2.003" expanded="true" name="Process"> <process expanded="true"> <operator activated="true" class="retrieve" compatibility="7.2.003" expanded="true" height="68" name="Retrieve Iris" width="90" x="112" y="85"> <parameter key="repository_entry" value="//Samples/data/Iris"/> </operator> <operator activated="true" class="r_scripting:execute_r" compatibility="7.2.000" expanded="true" height="103" name="Execute R" width="90" x="246" y="85"> <parameter key="script" value="# rm_main is a mandatory function, &#10;# the number of arguments has to be the number of input ports (can be none)&#10;rm_main = function(data)&#10;{&#10; print('Hello, world!')&#10; # output can be found in Log View&#10; &#10; # your code goes here&#10;&#10;&#9;data$label = factor(data$label)&#10;&#9;data2 = data&#10;&#9;data2$label = relevel(data2$label, ref = 'Iris-virginica')&#10;&#9;print(str(data))&#10;&#9;print(str(data2))&#10;&#9;&#10; return(list(data, data2))&#10;}&#10;"/> </operator> <connect from_op="Retrieve Iris" from_port="output" to_op="Execute R" to_port="input 1"/> <connect from_op="Execute R" from_port="output 1" to_port="result 1"/> <connect from_op="Execute R" from_port="output 2" to_port="result 2"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> <portSpacing port="sink_result 3" spacing="0"/> </process> </operator> </process> 运算符。这是一个更改虹膜数据集中标签级别的示例。如果查看RapidMiner日志,则可以看到显示结构的打印语句。

Set Role

我发现在R脚本之后删除了id和label角色,但可以使用{{1}}运算符修复此问题。