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
maximum value in each example
alhawary8611
Member Posts: 9 Contributor II
hello, i have a numerical dataset, how to keep the maximum value in each example (row) in its current location, and zeroize all other attributes values. i mean to show only the maximum value in example in its origin attributes.
0
Best Answer
-
lionelderkrikor RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
Does this process answer to your need ?
<?xml version="1.0" encoding="UTF-8"?><process version="8.1.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="read_excel" compatibility="8.1.001" expanded="true" height="68" name="Read Excel" width="90" x="112" y="34">
<parameter key="excel_file" value="C:\Users\Lionel\Documents\Formations_DataScience\Rapidminer\Tests_Rapidminer\Filter_max_values\Filter_max_values.xlsx"/>
<parameter key="imported_cell_range" value="A1:D5"/>
<parameter key="first_row_as_names" value="false"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<list key="data_set_meta_data_information">
<parameter key="0" value="Att1.true.integer.attribute"/>
<parameter key="1" value="Att2.true.integer.attribute"/>
<parameter key="2" value="Att3.true.integer.attribute"/>
<parameter key="3" value="Att4.true.integer.attribute"/>
</list>
</operator>
<operator activated="true" class="generate_aggregation" compatibility="8.1.001" expanded="true" height="82" name="Generate Aggregation" width="90" x="246" y="34">
<parameter key="attribute_name" value="Max_Att1"/>
<parameter key="attribute" value="Att1"/>
<parameter key="aggregation_function" value="maximum"/>
</operator>
<operator activated="true" class="concurrency:loop_attributes" compatibility="8.1.001" expanded="true" height="82" name="Loop Attributes" width="90" x="447" y="34">
<parameter key="attribute_filter_type" value="single"/>
<parameter key="attribute" value="Max_Att1"/>
<parameter key="invert_selection" value="true"/>
<process expanded="true">
<operator activated="true" class="generate_attributes" compatibility="8.1.001" expanded="true" height="82" name="Generate Attributes" width="90" x="380" y="34">
<list key="function_descriptions">
<parameter key="%{loop_attribute}" value="if(eval(%{loop_attribute}) == Max_Att1,eval(%{loop_attribute}),0)"/>
</list>
</operator>
<operator activated="true" class="select_attributes" compatibility="8.1.001" expanded="true" height="82" name="Select Attributes" width="90" x="581" y="34">
<parameter key="attribute_filter_type" value="single"/>
<parameter key="attribute" value="%{loop_attribute}"/>
<parameter key="regular_expression" value="Att1"/>
</operator>
<connect from_port="input 1" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_port="output 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
<portSpacing port="sink_output 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="operator_toolbox:merge" compatibility="0.9.000" expanded="true" height="82" name="Merge" width="90" x="648" y="34"/>
<connect from_op="Read Excel" from_port="output" to_op="Generate Aggregation" to_port="example set input"/>
<connect from_op="Generate Aggregation" from_port="example set output" to_op="Loop Attributes" to_port="input 1"/>
<connect from_op="Loop Attributes" from_port="output 1" to_op="Merge" to_port="example set 1"/>
<connect from_op="Merge" from_port="merged set" 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>Regards,
Lionel
0
Answers
hello @alhawary8611 welcome to the community! Some quick recommendations for you:
• Post your XML process here in this thread (see https://youtu.be/KkgB5QXWXJ8 and "Read Before Posting" on right when you reply)
• Attach your dataset if possible (use a fictionalized version if there are privacy concerns)
• Make sure you have all necessary extensions installed (see https://youtu.be/pjBqG3xtXx4)
Scott
Thank you Mr. Lionel. this is what i need.