Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
[SOLVED] index function in rapid miner for interger values
Hi all,
i am working with the rapid miner. I need to find the which attribute has the maximum value from three attributes having integer values in it.
e.g. i have 3 attributes p1,p2,p3.
pi=2, p2 = 3, p3 =6
in the new column i want ot have the name of the attribute having the maximum value.
in this case i need to have p3.
i have used max(p1,p2,p3). it gave me maximum value., but i want ot have the index value as p1,p2 or p3.
<code>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.3.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.3.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="6.3.000" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Local Repository/CSVMaximum"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="6.3.000" expanded="true" height="76" name="Generate Attributes" width="90" x="179" y="30">
<list key="function_descriptions">
<parameter key="new" value="max(p1,p2,p3)"/>
</list>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
</code>
i am working with the rapid miner. I need to find the which attribute has the maximum value from three attributes having integer values in it.
e.g. i have 3 attributes p1,p2,p3.
pi=2, p2 = 3, p3 =6
in the new column i want ot have the name of the attribute having the maximum value.
in this case i need to have p3.
i have used max(p1,p2,p3). it gave me maximum value., but i want ot have the index value as p1,p2 or p3.
<code>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.3.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.3.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="6.3.000" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Local Repository/CSVMaximum"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="6.3.000" expanded="true" height="76" name="Generate Attributes" width="90" x="179" y="30">
<list key="function_descriptions">
<parameter key="new" value="max(p1,p2,p3)"/>
</list>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
</code>
0
Answers
you solved my problem.
Regards:
Sukh