The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.
Options

Time Series Forecasting - Interpreting Testing Results

betulbetul Member Posts: 1 Contributor I
edited November 2018 in Help
Hi everyone,

I am a new user of RapidMiner and this is my first post, I want to forecast direction of stock market index daily data. So I followed RapidMiner financial time series modeling video tutorial by Thomas Ott : http://www.youtube.com/watch?v=UmGIGEJMmN8


My output is like below:

date              prediction(label)      imkb-0     ma14-0     ma37-0    rsi14-0
01.05.2007       10.853                10.891     10.955     10.903     42.857
02.05.2007       10.878                10.908     10.952      10.905    42.857
...

imkb-0 is the label that I want to predict. It is normalized version of Istanbul Stock Exchange index data.
ma14-0, ma37-0, rsi14-0 are regular attributes which correspond to moving average of imkb for 14 days, 37 days, and relative strength index for 14 days.


Can I use the following method to predict the direction of the stock market:

if  pred_2 - pred_1 > 0 && imkb-0_2  - imkb-0_1 > 0  ||  pred_2 - pred_1 < 0 && imkb-0_2  - imkb-0_1 < 0  ||  pred_2 - pred_1 = 0 && imkb-0_2  - imkb-0_1 = 0   then direction_prediction is true,
else direction_prediction is false.


Here is the XML code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.003">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.2.003" expanded="true" name="Process">
   <process expanded="true" height="514" width="614">
     <operator activated="true" class="read_excel" compatibility="5.2.003" expanded="true" height="60" name="Read Excel" width="90" x="29" y="78">
       <parameter key="excel_file" value="C:\Users\Betul\Documents\betülün dersleri\CMPE492\16 mayıs imkb ma rsi data training.xls"/>
       <parameter key="imported_cell_range" value="A1:E333"/>
       <parameter key="first_row_as_names" value="false"/>
       <list key="annotations">
         <parameter key="0" value="Name"/>
       </list>
       <parameter key="date_format" value="dd-MM-yyyy"/>
       <list key="data_set_meta_data_information">
         <parameter key="0" value="tarih.true.date.id"/>
         <parameter key="1" value="imkb.true.real.attribute"/>
         <parameter key="2" value="ma14.true.real.attribute"/>
         <parameter key="3" value="ma37.true.real.attribute"/>
         <parameter key="4" value="rsi14.true.numeric.attribute"/>
       </list>
     </operator>
     <operator activated="true" class="set_role" compatibility="5.2.003" expanded="true" height="76" name="Set Role" width="90" x="112" y="75">
       <parameter key="name" value="tarih"/>
       <parameter key="target_role" value="id"/>
       <list key="set_additional_roles"/>
     </operator>
     <operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing" width="90" x="246" y="75">
       <parameter key="horizon" value="1"/>
       <parameter key="window_size" value="1"/>
       <parameter key="create_label" value="true"/>
       <parameter key="label_attribute" value="imkb"/>
     </operator>
     <operator activated="true" class="series:sliding_window_validation" compatibility="5.1.002" expanded="true" height="112" name="Validation" width="90" x="447" y="120">
       <parameter key="training_window_width" value="20"/>
       <parameter key="training_window_step_size" value="5"/>
       <parameter key="test_window_width" value="20"/>
       <parameter key="horizon" value="5"/>
       <parameter key="average_performances_only" value="false"/>
       <process expanded="true" height="408" width="165">
         <operator activated="true" class="support_vector_machine" compatibility="5.2.003" expanded="true" height="112" name="SVM" width="90" x="45" y="30">
           <parameter key="kernel_type" value="polynomial"/>
           <parameter key="C" value="100.0"/>
         </operator>
         <connect from_port="training" to_op="SVM" to_port="training set"/>
         <connect from_op="SVM" from_port="model" to_port="model"/>
         <portSpacing port="source_training" spacing="0"/>
         <portSpacing port="sink_model" spacing="0"/>
         <portSpacing port="sink_through 1" spacing="0"/>
       </process>
       <process expanded="true" height="408" width="435">
         <operator activated="true" class="apply_model" compatibility="5.2.003" expanded="true" height="76" name="Apply Model" width="90" x="45" y="30">
           <list key="application_parameters"/>
           <parameter key="create_view" value="true"/>
         </operator>
         <operator activated="true" class="series:forecasting_performance" compatibility="5.1.002" expanded="true" height="76" name="Performance" width="90" x="246" y="30">
           <parameter key="horizon" value="1"/>
         </operator>
         <connect from_port="model" to_op="Apply Model" to_port="model"/>
         <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
         <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
         <connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
         <portSpacing port="source_model" spacing="0"/>
         <portSpacing port="source_test set" spacing="0"/>
         <portSpacing port="source_through 1" spacing="0"/>
         <portSpacing port="sink_averagable 1" spacing="0"/>
         <portSpacing port="sink_averagable 2" spacing="0"/>
       </process>
     </operator>
     <operator activated="true" class="write_model" compatibility="5.2.003" expanded="true" height="60" name="Write Model" width="90" x="447" y="30">
       <parameter key="model_file" value="C:\Users\Betul\Documents\sonuc.xml"/>
     </operator>
     <operator activated="true" class="read_excel" compatibility="5.2.003" expanded="true" height="60" name="Read Excel (2)" width="90" x="38" y="218">
       <parameter key="excel_file" value="C:\Users\Betul\Documents\betülün dersleri\CMPE492\16 mayıs imkb ma rsi data test.xls"/>
       <parameter key="imported_cell_range" value="A1:E170"/>
       <parameter key="first_row_as_names" value="false"/>
       <list key="annotations">
         <parameter key="0" value="Name"/>
       </list>
       <parameter key="date_format" value="dd-MM-yyyy"/>
       <list key="data_set_meta_data_information">
         <parameter key="0" value="tarih.true.date.id"/>
         <parameter key="1" value="imkb.true.real.attribute"/>
         <parameter key="2" value="ma14.true.real.attribute"/>
         <parameter key="3" value="ma37.true.real.attribute"/>
         <parameter key="4" value="rsi14.true.numeric.attribute"/>
       </list>
     </operator>
     <operator activated="true" class="set_role" compatibility="5.2.003" expanded="true" height="76" name="Set Role (2)" width="90" x="179" y="210">
       <parameter key="name" value="tarih"/>
       <parameter key="target_role" value="id"/>
       <list key="set_additional_roles"/>
     </operator>
     <operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing (2)" width="90" x="313" y="210">
       <parameter key="window_size" value="1"/>
       <parameter key="create_label" value="true"/>
       <parameter key="label_attribute" value="imkb"/>
     </operator>
     <operator activated="true" class="read_model" compatibility="5.2.003" expanded="true" height="60" name="Read Model" width="90" x="447" y="255">
       <parameter key="model_file" value="C:\Users\Betul\Documents\sonuc.xml"/>
     </operator>
     <operator activated="true" class="apply_model" compatibility="5.2.003" expanded="true" height="76" name="Apply Model (2)" width="90" x="436" y="343">
       <list key="application_parameters"/>
     </operator>
     <connect from_op="Read Excel" from_port="output" to_op="Set Role" to_port="example set input"/>
     <connect from_op="Set Role" from_port="example set output" to_op="Windowing" to_port="example set input"/>
     <connect from_op="Windowing" from_port="example set output" to_op="Validation" to_port="training"/>
     <connect from_op="Validation" from_port="model" to_op="Write Model" to_port="input"/>
     <connect from_op="Validation" from_port="training" to_port="result 1"/>
     <connect from_op="Validation" from_port="averagable 1" to_port="result 2"/>
     <connect from_op="Read Excel (2)" from_port="output" to_op="Set Role (2)" to_port="example set input"/>
     <connect from_op="Set Role (2)" from_port="example set output" to_op="Windowing (2)" to_port="example set input"/>
     <connect from_op="Windowing (2)" from_port="example set output" to_op="Apply Model (2)" to_port="unlabelled data"/>
     <connect from_op="Read Model" from_port="output" to_op="Apply Model (2)" to_port="model"/>
     <connect from_op="Apply Model (2)" from_port="labelled data" to_port="result 3"/>
     <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"/>
     <portSpacing port="sink_result 4" spacing="0"/>
   </process>
 </operator>
</process>

Thanks in advance,

Betül



Answers

  • Options
    fritmorefritmore Member Posts: 90 Contributor II
    you can really only tell after the market moved  ;D

    are you trying to develop a decision rule by that logical expression?

    look at how the validation operator classified the correct and wrong predictions.
    and keep in mind causation :)

Sign In or Register to comment.