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
Create new dataset from logical event?
Mark_Knecht
Member Posts: 10 Contributor II
Hi all,
I'm completely new to RapidMiner and working through the demo videos and online tutorials, but at the same time trying to piece together how I'd use RapidMiner to look for certain things in a time series. I've got a lot to learn.
I have a goal with this code:
1) Read some SPY data
2) Take a 5 period moving average of the close (MA_Fast)
3) Take a 4 period moving average of MA_Fast (MA_Slow)
4) Each time MA_Fast crosses above or below MA_Slow build a new new data set of the SPY data on the next cycle which includes all the data columns in the original set (Date, Time, Open, High
I'm attaching a little bit of code which _might_ do something like steps 1-3, but I'm clueless as to how I do step 4. Can someone give me a hint? The multipliers are, in my mind, are creating results outputs that would go to some other piece of logic I don't know how to do now, not the actual output of the design.
I'm also not sure I've defined labels in the original SPY data correctly. Columns are correctly names, but really both Date and Time seem like the label to me and so far it seems RM wants to only accept a single label. I'm probably doing somethign wrong there also.
Thanks,
Mark
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.0">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" expanded="true" name="Process">
<process expanded="true" height="586" width="413">
<operator activated="true" class="retrieve" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
<parameter key="repository_entry" value="//NewLocalRepository/Mark1/data/SPY_Daily"/>
</operator>
<operator activated="true" class="multiply" expanded="true" height="94" name="Multiply (2)" width="90" x="179" y="30"/>
<operator activated="true" class="series:moving_average" expanded="true" height="76" name="Moving Average" width="90" x="112" y="165">
<parameter key="attribute_name" value="Close"/>
</operator>
<operator activated="true" class="multiply" expanded="true" height="94" name="Multiply" width="90" x="112" y="255"/>
<operator activated="true" class="series:moving_average" expanded="true" height="76" name="Moving Average (3)" width="90" x="246" y="300">
<parameter key="attribute_name" value="Close"/>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Multiply (2)" to_port="input"/>
<connect from_op="Multiply (2)" from_port="output 1" to_port="result 1"/>
<connect from_op="Multiply (2)" from_port="output 2" to_op="Moving Average" to_port="example set input"/>
<connect from_op="Moving Average" from_port="example set output" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_port="result 2"/>
<connect from_op="Multiply" from_port="output 2" to_op="Moving Average (3)" to_port="example set input"/>
<connect from_op="Moving Average (3)" from_port="example set output" to_port="result 3"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="144"/>
<portSpacing port="sink_result 3" spacing="90"/>
<portSpacing port="sink_result 4" spacing="0"/>
</process>
</operator>
</process>
I'm completely new to RapidMiner and working through the demo videos and online tutorials, but at the same time trying to piece together how I'd use RapidMiner to look for certain things in a time series. I've got a lot to learn.
I have a goal with this code:
1) Read some SPY data
2) Take a 5 period moving average of the close (MA_Fast)
3) Take a 4 period moving average of MA_Fast (MA_Slow)
4) Each time MA_Fast crosses above or below MA_Slow build a new new data set of the SPY data on the next cycle which includes all the data columns in the original set (Date, Time, Open, High
I'm attaching a little bit of code which _might_ do something like steps 1-3, but I'm clueless as to how I do step 4. Can someone give me a hint? The multipliers are, in my mind, are creating results outputs that would go to some other piece of logic I don't know how to do now, not the actual output of the design.
I'm also not sure I've defined labels in the original SPY data correctly. Columns are correctly names, but really both Date and Time seem like the label to me and so far it seems RM wants to only accept a single label. I'm probably doing somethign wrong there also.
Thanks,
Mark
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.0">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" expanded="true" name="Process">
<process expanded="true" height="586" width="413">
<operator activated="true" class="retrieve" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
<parameter key="repository_entry" value="//NewLocalRepository/Mark1/data/SPY_Daily"/>
</operator>
<operator activated="true" class="multiply" expanded="true" height="94" name="Multiply (2)" width="90" x="179" y="30"/>
<operator activated="true" class="series:moving_average" expanded="true" height="76" name="Moving Average" width="90" x="112" y="165">
<parameter key="attribute_name" value="Close"/>
</operator>
<operator activated="true" class="multiply" expanded="true" height="94" name="Multiply" width="90" x="112" y="255"/>
<operator activated="true" class="series:moving_average" expanded="true" height="76" name="Moving Average (3)" width="90" x="246" y="300">
<parameter key="attribute_name" value="Close"/>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Multiply (2)" to_port="input"/>
<connect from_op="Multiply (2)" from_port="output 1" to_port="result 1"/>
<connect from_op="Multiply (2)" from_port="output 2" to_op="Moving Average" to_port="example set input"/>
<connect from_op="Moving Average" from_port="example set output" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_port="result 2"/>
<connect from_op="Multiply" from_port="output 2" to_op="Moving Average (3)" to_port="example set input"/>
<connect from_op="Moving Average (3)" from_port="example set output" to_port="result 3"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="144"/>
<portSpacing port="sink_result 3" spacing="90"/>
<portSpacing port="sink_result 4" spacing="0"/>
</process>
</operator>
</process>
0
Answers
take a look at this process: Ciao Sebastian