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
How to find the 3 highest values and the 3 lowest values?
Hello,
I have an attribute called price. I want to find the 5 highest values and 5 lowest (e.g if my column contains prices 1,2,3,4,5,6,7,8,9,10,11) this should give me 1,2,3,9,10,11. I hope I am being clear enough. Now I know how do do this seperately by sorting and filtering, I cant seem to find a way to generate this in one go.
Please help. Please go easy on me as I am a newbie
I have an attribute called price. I want to find the 5 highest values and 5 lowest (e.g if my column contains prices 1,2,3,4,5,6,7,8,9,10,11) this should give me 1,2,3,9,10,11. I hope I am being clear enough. Now I know how do do this seperately by sorting and filtering, I cant seem to find a way to generate this in one go.
Please help. Please go easy on me as I am a newbie
0
Best Answer
-
IngoRM Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM FounderHi @Khiba,Another alternative - although a bit cumbersome is to combine the operators "Aggregate", "Sort", "Filter Example Range", and "Append"... The XML for this process is below.Hope this helps,
Ingo<?xml version="1.0" encoding="UTF-8"?><process version="9.2.000"><br> <context><br> <input/><br> <output/><br> <macros/><br> </context><br> <operator activated="true" class="process" compatibility="9.2.000" expanded="true" name="Process"><br> <parameter key="logverbosity" value="init"/><br> <parameter key="random_seed" value="2001"/><br> <parameter key="send_mail" value="never"/><br> <parameter key="notification_email" value=""/><br> <parameter key="process_duration_for_mail" value="30"/><br> <parameter key="encoding" value="UTF-8"/><br> <process expanded="true"><br> <operator activated="true" class="retrieve" compatibility="9.2.000" expanded="true" height="68" name="Retrieve Titanic" width="90" x="45" y="34"><br> <parameter key="repository_entry" value="//Samples/data/Titanic"/><br> </operator><br> <operator activated="true" class="aggregate" compatibility="9.2.000" expanded="true" height="82" name="Aggregate" width="90" x="179" y="34"><br> <parameter key="use_default_aggregation" value="false"/><br> <parameter key="attribute_filter_type" value="all"/><br> <parameter key="attribute" value=""/><br> <parameter key="attributes" value=""/><br> <parameter key="use_except_expression" value="false"/><br> <parameter key="value_type" value="attribute_value"/><br> <parameter key="use_value_type_exception" value="false"/><br> <parameter key="except_value_type" value="time"/><br> <parameter key="block_type" value="attribute_block"/><br> <parameter key="use_block_type_exception" value="false"/><br> <parameter key="except_block_type" value="value_matrix_row_start"/><br> <parameter key="invert_selection" value="false"/><br> <parameter key="include_special_attributes" value="false"/><br> <parameter key="default_aggregation_function" value="average"/><br> <list key="aggregation_attributes"><br> <parameter key="Age" value="count"/><br> </list><br> <parameter key="group_by_attributes" value="Age"/><br> <parameter key="count_all_combinations" value="false"/><br> <parameter key="only_distinct" value="false"/><br> <parameter key="ignore_missings" value="true"/><br> </operator><br> <operator activated="true" class="select_attributes" compatibility="9.2.000" expanded="true" height="82" name="Select Attributes" width="90" x="313" y="34"><br> <parameter key="attribute_filter_type" value="single"/><br> <parameter key="attribute" value="Age"/><br> <parameter key="attributes" value=""/><br> <parameter key="use_except_expression" value="false"/><br> <parameter key="value_type" value="attribute_value"/><br> <parameter key="use_value_type_exception" value="false"/><br> <parameter key="except_value_type" value="time"/><br> <parameter key="block_type" value="attribute_block"/><br> <parameter key="use_block_type_exception" value="false"/><br> <parameter key="except_block_type" value="value_matrix_row_start"/><br> <parameter key="invert_selection" value="false"/><br> <parameter key="include_special_attributes" value="false"/><br> </operator><br> <operator activated="true" class="filter_examples" compatibility="9.2.000" expanded="true" height="103" name="Filter Examples" width="90" x="447" y="34"><br> <parameter key="parameter_expression" value=""/><br> <parameter key="condition_class" value="custom_filters"/><br> <parameter key="invert_filter" value="false"/><br> <list key="filters_list"><br> <parameter key="filters_entry_key" value="Age.is_not_missing."/><br> </list><br> <parameter key="filters_logic_and" value="true"/><br> <parameter key="filters_check_metadata" value="true"/><br> </operator><br> <operator activated="true" class="sort" compatibility="9.2.000" expanded="true" height="82" name="Sort" width="90" x="581" y="85"><br> <parameter key="attribute_name" value="Age"/><br> <parameter key="sorting_direction" value="increasing"/><br> </operator><br> <operator activated="true" class="sort" compatibility="9.2.000" expanded="true" height="82" name="Sort (2)" width="90" x="715" y="136"><br> <parameter key="attribute_name" value="Age"/><br> <parameter key="sorting_direction" value="decreasing"/><br> </operator><br> <operator activated="true" class="filter_example_range" compatibility="9.2.000" expanded="true" height="82" name="Filter Example Range (2)" width="90" x="849" y="136"><br> <parameter key="first_example" value="1"/><br> <parameter key="last_example" value="5"/><br> <parameter key="invert_filter" value="false"/><br> </operator><br> <operator activated="true" class="filter_example_range" compatibility="9.2.000" expanded="true" height="82" name="Filter Example Range" width="90" x="849" y="34"><br> <parameter key="first_example" value="1"/><br> <parameter key="last_example" value="5"/><br> <parameter key="invert_filter" value="false"/><br> </operator><br> <operator activated="true" class="append" compatibility="9.2.000" expanded="true" height="103" name="Append" width="90" x="983" y="85"><br> <parameter key="datamanagement" value="double_array"/><br> <parameter key="data_management" value="auto"/><br> <parameter key="merge_type" value="all"/><br> </operator><br> <operator activated="true" class="sort" compatibility="9.2.000" expanded="true" height="82" name="Sort (3)" width="90" x="1117" y="85"><br> <parameter key="attribute_name" value="Age"/><br> <parameter key="sorting_direction" value="increasing"/><br> </operator><br> <connect from_op="Retrieve Titanic" from_port="output" to_op="Aggregate" to_port="example set input"/><br> <connect from_op="Aggregate" from_port="example set output" to_op="Select Attributes" to_port="example set input"/><br> <connect from_op="Select Attributes" from_port="example set output" to_op="Filter Examples" to_port="example set input"/><br> <connect from_op="Filter Examples" from_port="example set output" to_op="Sort" to_port="example set input"/><br> <connect from_op="Sort" from_port="example set output" to_op="Filter Example Range" to_port="example set input"/><br> <connect from_op="Sort" from_port="original" to_op="Sort (2)" to_port="example set input"/><br> <connect from_op="Sort (2)" from_port="example set output" to_op="Filter Example Range (2)" to_port="example set input"/><br> <connect from_op="Filter Example Range (2)" from_port="example set output" to_op="Append" to_port="example set 2"/><br> <connect from_op="Filter Example Range" from_port="example set output" to_op="Append" to_port="example set 1"/><br> <connect from_op="Append" from_port="merged set" to_op="Sort (3)" to_port="example set input"/><br> <connect from_op="Sort (3)" from_port="example set output" to_port="result 1"/><br> <portSpacing port="source_input 1" spacing="0"/><br> <portSpacing port="sink_result 1" spacing="21"/><br> <portSpacing port="sink_result 2" spacing="0"/><br> </process><br> </operator><br></process>
7
Answers
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts
Scott