Finding local maxima / minima in example set?
jxstanford
New Altair Community Member
Hi,
I'm new to RapidMinder, and have been trying to solve a relatively simple problem. I have an example set of data that looks something like this:
Row # Price Volume
39 1202.75 224154.0
40 1202.5 217572.0
41 1202.25 199591.0
42 1202.0 204750.0
43 1201.75 266680.0
44 1201.5 291936.0
45 1201.25 331373.0
46 1201.0 294569.0
47 1200.75 299276.0
48 1200.5 294512.0
49 1200.25 324764.0
50 1200.0 345603.0
51 1199.75 377726.0
52 1199.5 372731.0
53 1199.25 388289.0
54 1199.0 393902.0
55 1198.75 355086.0
56 1198.5 367223.0
I would like to create two new example sets. The first one should have all of the rows that are the lowest volume within +/- 10 rows. The second should have all of the rows that are the highest volume within +/- 10 rows.
I've experimented with a couple things, but could use some guidance from someone more experienced with RapidMiner. Any pointers?
Thanks,
John
I'm new to RapidMinder, and have been trying to solve a relatively simple problem. I have an example set of data that looks something like this:
Row # Price Volume
39 1202.75 224154.0
40 1202.5 217572.0
41 1202.25 199591.0
42 1202.0 204750.0
43 1201.75 266680.0
44 1201.5 291936.0
45 1201.25 331373.0
46 1201.0 294569.0
47 1200.75 299276.0
48 1200.5 294512.0
49 1200.25 324764.0
50 1200.0 345603.0
51 1199.75 377726.0
52 1199.5 372731.0
53 1199.25 388289.0
54 1199.0 393902.0
55 1198.75 355086.0
56 1198.5 367223.0
I would like to create two new example sets. The first one should have all of the rows that are the lowest volume within +/- 10 rows. The second should have all of the rows that are the highest volume within +/- 10 rows.
I've experimented with a couple things, but could use some guidance from someone more experienced with RapidMiner. Any pointers?
Thanks,
John
Tagged:
0
Answers
-
Hi John,
here it comes. Simply use a sort and a Filter Example Range operator<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Greetings,
<process version="5.0">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.0.8" expanded="true" name="Process">
<process expanded="true" height="391" width="957">
<operator activated="true" class="generate_data" compatibility="5.0.8" expanded="true" height="60" name="Generate Data" width="90" x="47" y="46"/>
<operator activated="true" class="multiply" compatibility="5.0.8" expanded="true" height="94" name="Multiply" width="90" x="179" y="75"/>
<operator activated="true" class="sort" compatibility="5.0.8" expanded="true" height="76" name="Sort (2)" width="90" x="380" y="120">
<parameter key="attribute_name" value="att1"/>
<parameter key="sorting_direction" value="decreasing"/>
</operator>
<operator activated="true" class="filter_example_range" compatibility="5.0.8" expanded="true" height="76" name="Filter Example Range (2)" width="90" x="514" y="120">
<parameter key="first_example" value="1"/>
<parameter key="last_example" value="10"/>
</operator>
<operator activated="true" class="sort" compatibility="5.0.8" expanded="true" height="76" name="Sort" width="90" x="380" y="30">
<parameter key="attribute_name" value="att1"/>
</operator>
<operator activated="true" class="filter_example_range" compatibility="5.0.8" expanded="true" height="76" name="Filter Example Range" width="90" x="514" y="30">
<parameter key="first_example" value="1"/>
<parameter key="last_example" value="10"/>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Sort" to_port="example set input"/>
<connect from_op="Multiply" from_port="output 2" to_op="Sort (2)" to_port="example set input"/>
<connect from_op="Sort (2)" from_port="example set output" to_op="Filter Example Range (2)" to_port="example set input"/>
<connect from_op="Filter Example Range (2)" from_port="example set output" to_port="result 2"/>
<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"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
Sebastian0