I want to filter my results (document occurrence) by the most frequent (the 10 most popular them). How do I do that?
Asked
Active
Viewed 1,174 times
1 Answers
1
One way would be to use a sort
operator followed by a filter
. For example, sorting and filtering the sample Iris dataset by a1
:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
<process expanded="true" height="417" width="675">
<operator activated="true" class="retrieve" compatibility="5.2.008" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Samples/data/Iris"/>
</operator>
<operator activated="true" class="sort" compatibility="5.2.008" expanded="true" height="76" name="Sort" width="90" x="179" y="30">
<parameter key="attribute_name" value="a1"/>
<parameter key="sorting_direction" value="decreasing"/>
</operator>
<operator activated="true" class="filter_example_range" compatibility="5.2.008" expanded="true" height="76" name="Filter Example Range" width="90" x="313" y="30">
<parameter key="first_example" value="1"/>
<parameter key="last_example" value="10"/>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Sort" to_port="example set input"/>
<connect from_op="Sort" from_port="example set output" to_op="Filter Example Range" to_port="example set input"/>
<connect from_op="Filter Example Range" 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>

aquavitae
- 17,414
- 11
- 63
- 106