The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[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