Options

Forecasting Future Confusion

cmLscmLs Member Posts: 7 Contributor I
edited December 2018 in Help

Hi I am very new at RM community.

I am trying to forecast the future with time series and i read most of the time series post and apply it my study. 

However i still can't forecast the future and i didn't understand whats wrong with my model. 

For test and train the model i split the data manually as labelled and unlabelled to prevent the confusion because i used very small dataset. 

However i also tried this model with more extensive dataset and i cant get future values anyhow. Model still produces forecasts of in sample. 

What i missed in the model and what should I do to get future values from my model?

 

Loop.PNGProcess.PNGValidation.PNGThanks in advance. 

<?xml version="1.0" encoding="UTF-8"?><process version="7.6.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="7.6.001" expanded="true" height="68" name="Retrieve" width="90" x="112" y="85">
<parameter key="repository_entry" value="data/Yıllık Kömür VeriLabelled"/>
</operator>
<operator activated="true" class="set_role" compatibility="7.6.001" expanded="true" height="82" name="Set Role" width="90" x="246" y="85">
<parameter key="attribute_name" value="Yükleme"/>
<parameter key="target_role" value="label"/>
<list key="set_additional_roles">
<parameter key="Year" value="id"/>
<parameter key="Yükleme" value="label"/>
</list>
</operator>
<operator activated="true" class="series:windowing" compatibility="7.4.000" expanded="true" height="82" name="Windowing" width="90" x="380" y="85">
<parameter key="window_size" value="1"/>
<parameter key="create_label" value="true"/>
<parameter key="label_attribute" value="Yükleme"/>
<parameter key="horizon" value="2"/>
</operator>
<operator activated="true" class="series:sliding_window_validation" compatibility="7.4.000" expanded="true" height="124" name="Validation" width="90" x="581" y="85">
<parameter key="training_window_width" value="2"/>
<parameter key="test_window_width" value="1"/>
<parameter key="horizon" value="2"/>
<process expanded="true">
<operator activated="true" class="neural_net" compatibility="7.6.001" expanded="true" height="82" name="Neural Net" width="90" x="313" y="136">
<list key="hidden_layers"/>
</operator>
<connect from_port="training" to_op="Neural Net" to_port="training set"/>
<connect from_op="Neural Net" 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">
<operator activated="true" class="apply_model" compatibility="7.6.001" expanded="true" height="82" name="Apply Model" width="90" x="112" y="34">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="series:forecasting_performance" compatibility="7.4.000" expanded="true" height="82" name="Performance" width="90" x="313" y="34">
<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="retrieve" compatibility="7.6.001" expanded="true" height="68" name="Retrieve (2)" width="90" x="112" y="289">
<parameter key="repository_entry" value="data/Yıllık Kömür VeriUnLabelled"/>
</operator>
<operator activated="true" class="series:windowing" compatibility="7.4.000" expanded="true" height="82" name="Windowing (2)" width="90" x="246" y="289">
<parameter key="window_size" value="1"/>
<parameter key="create_label" value="true"/>
<parameter key="label_attribute" value="Yükleme"/>
<parameter key="horizon" value="2"/>
</operator>
<operator activated="true" class="multiply" compatibility="7.6.001" expanded="true" height="103" name="Multiply" width="90" x="380" y="289"/>
<operator activated="true" class="apply_model" compatibility="7.6.001" expanded="true" height="82" name="Apply Model (2)" width="90" x="581" y="289">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="7.6.001" expanded="true" height="68" name="Extract Macro" width="90" x="179" y="442">
<parameter key="macro" value="n_examples"/>
<list key="additional_macros"/>
</operator>
<operator activated="true" class="generate_macro" compatibility="7.6.001" expanded="true" height="82" name="Generate Macro" width="90" x="313" y="442">
<list key="function_descriptions">
<parameter key="filter_range" value="eval(%{n_examples}) - 1"/>
</list>
</operator>
<operator activated="true" class="filter_example_range" compatibility="7.6.001" expanded="true" height="82" name="Filter Example Range" width="90" x="447" y="442">
<parameter key="first_example" value="1"/>
<parameter key="last_example" value="%{filter_range}"/>
<parameter key="invert_filter" value="true"/>
</operator>
<operator activated="true" class="remember" compatibility="7.6.001" expanded="true" height="68" name="Remember" width="90" x="581" y="442">
<parameter key="name" value="Lastrow"/>
</operator>
<operator activated="true" class="concurrency:loop" compatibility="7.6.001" expanded="true" height="82" name="Loop" width="90" x="849" y="442">
<process expanded="true">
<operator activated="true" class="recall" compatibility="7.6.001" expanded="true" height="68" name="Recall" width="90" x="45" y="187">
<parameter key="name" value="Lastrow"/>
<parameter key="remove_from_store" value="false"/>
</operator>
<operator activated="true" class="apply_model" compatibility="7.6.001" expanded="true" height="82" name="Apply Model (3)" width="90" x="246" y="85">
<list key="application_parameters"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="7.6.001" expanded="true" height="82" name="Generate Attributes" width="90" x="380" y="85">
<list key="function_descriptions">
<parameter key="loadingpre" value="date_add(Year,eval(%{n_examples}),DATE_UNIT_YEAR)"/>
</list>
</operator>
<operator activated="true" class="set_role" compatibility="7.6.001" expanded="true" height="82" name="Set Role (2)" width="90" x="514" y="34">
<parameter key="attribute_name" value="prediction(label)"/>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="select_attributes" compatibility="7.6.001" expanded="true" height="82" name="Select Attributes" width="90" x="648" y="34">
<parameter key="attribute_filter_type" value="single"/>
<parameter key="attribute" value="prediction(label)"/>
</operator>
<operator activated="true" class="replace" compatibility="7.6.001" expanded="true" height="82" name="Replace" width="90" x="782" y="34">
<parameter key="replace_what" value="yüklemepre"/>
<parameter key="replace_by" value="1"/>
</operator>
<operator activated="true" class="materialize_data" compatibility="7.6.001" expanded="true" height="82" name="Materialize Data" width="90" x="916" y="34"/>
<connect from_port="input 1" to_op="Apply Model (3)" to_port="model"/>
<connect from_op="Recall" from_port="result" to_op="Apply Model (3)" to_port="unlabelled data"/>
<connect from_op="Apply Model (3)" from_port="labelled data" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
<connect from_op="Set Role (2)" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Replace" to_port="example set input"/>
<connect from_op="Replace" from_port="example set output" to_op="Materialize Data" to_port="example set input"/>
<connect from_op="Materialize Data" from_port="example set output" to_port="output 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="source_input 2" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
<portSpacing port="sink_output 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="append" compatibility="7.6.001" expanded="true" height="82" name="Append" width="90" x="983" y="442"/>
<connect from_op="Retrieve" 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="Apply Model (2)" to_port="model"/>
<connect from_op="Validation" from_port="averagable 1" to_port="result 2"/>
<connect from_op="Retrieve (2)" from_port="output" to_op="Windowing (2)" to_port="example set input"/>
<connect from_op="Windowing (2)" from_port="example set output" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Multiply" from_port="output 2" to_op="Apply Model (2)" to_port="unlabelled data"/>
<connect from_op="Apply Model (2)" from_port="labelled data" to_port="result 3"/>
<connect from_op="Apply Model (2)" from_port="model" to_op="Loop" to_port="input 1"/>
<connect from_op="Extract Macro" from_port="example set" to_op="Generate Macro" to_port="through 1"/>
<connect from_op="Generate Macro" from_port="through 1" to_op="Filter Example Range" to_port="example set input"/>
<connect from_op="Filter Example Range" from_port="example set output" to_op="Remember" to_port="store"/>
<connect from_op="Loop" from_port="output 1" to_op="Append" to_port="example set 1"/>
<connect from_op="Append" from_port="merged set" 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"/>
<portSpacing port="sink_result 4" spacing="0"/>
<description align="center" color="yellow" colored="true" height="197" resized="true" width="629" x="70" y="38">Train the Model</description>
<description align="center" color="purple" colored="true" height="140" resized="true" width="443" x="70" y="257">Test the Model</description>
<description align="center" color="blue" colored="true" height="130" resized="true" width="998" x="97" y="423">Generate Future Predictions</description>
</process>
</operator>
</process>

 

Tagged:

Best Answer

  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    Solution Accepted

    Hi again @cmLs,

     

    I resolved the problem of predictions : Now there are relevant predictions with the Vector Linear Regression operator.

    (I choose this operator because "Energy" has a general trend of (pseudo)linear increase.

    I test Neural Nets but I have always the same value for all the predict years. Maybe you can test it on larger datasets and set the "horizon" to a greater value to see if predictions are more relevant.

    You can so test other models, or better, use the Vote operator which allow to combine the predictions of several models.

    To answer to your question, yes, you can use the Union operator for the other attributes.

    The new process looks like that : 

    <?xml version="1.0" encoding="UTF-8"?><process version="8.0.001">
    <context>
    <input/>
    <output/>
    <macros>
    <macro>
    <key>futureMonths</key>
    <value>15</value>
    </macro>
    <macro>
    <key>horizon</key>
    <value>1</value>
    </macro>
    <macro>
    <key>windowSize</key>
    <value>6</value>
    </macro>
    </macros>
    </context>
    <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" breakpoints="after" class="read_csv" compatibility="6.0.003" expanded="true" height="68" name="Read CSV" width="90" x="45" y="85">
    <parameter key="csv_file" value="C:\Users\Lionel\Documents\Formations_DataScience\Rapidminer\Tests_Rapidminer\Yıllık Kömür VeriLabelled.csv"/>
    <parameter key="date_format" value="MM/dd/yyyy"/>
    <parameter key="first_row_as_names" value="false"/>
    <list key="annotations">
    <parameter key="0" value="Name"/>
    </list>
    <parameter key="encoding" value="windows-1252"/>
    <list key="data_set_meta_data_information">
    <parameter key="0" value="Yükleme.true.integer.attribute"/>
    <parameter key="1" value="BoÅŸaltma.true.integer.attribute"/>
    <parameter key="2" value="GDP.true.integer.attribute"/>
    <parameter key="3" value="Sanayi endeskis.true.integer.attribute"/>
    <parameter key="4" value="Nufus.true.integer.attribute"/>
    <parameter key="5" value="Energy.true.integer.attribute"/>
    <parameter key="6" value="Year.true.date.attribute"/>
    </list>
    </operator>
    <operator activated="true" class="subprocess" compatibility="8.0.001" expanded="true" height="82" name="Set Predictions_Params" width="90" x="179" y="85">
    <process expanded="true">
    <operator activated="true" class="set_macro" compatibility="8.0.001" expanded="true" height="82" name="Set Window_Size" width="90" x="45" y="34">
    <parameter key="macro" value="WindowSize"/>
    <parameter key="value" value="5"/>
    </operator>
    <operator activated="true" class="set_macro" compatibility="8.0.001" expanded="true" height="82" name="Set Horizon" width="90" x="179" y="34">
    <parameter key="macro" value="horizon"/>
    <parameter key="value" value="1"/>
    </operator>
    <operator activated="true" class="set_macro" compatibility="8.0.001" expanded="true" height="82" name="Set Future_Years" width="90" x="313" y="34">
    <parameter key="macro" value="futureYears"/>
    <parameter key="value" value="6"/>
    </operator>
    <connect from_port="in 1" to_op="Set Window_Size" to_port="through 1"/>
    <connect from_op="Set Window_Size" from_port="through 1" to_op="Set Horizon" to_port="through 1"/>
    <connect from_op="Set Horizon" from_port="through 1" to_op="Set Future_Years" to_port="through 1"/>
    <connect from_op="Set Future_Years" from_port="through 1" to_port="out 1"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="source_in 2" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role" width="90" x="313" y="85">
    <parameter key="attribute_name" value="Year"/>
    <parameter key="target_role" value="id"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="8.0.001" expanded="true" height="82" name="Select Attributes" width="90" x="447" y="85">
    <parameter key="attribute_filter_type" value="subset"/>
    <parameter key="attributes" value="Energy"/>
    </operator>
    <operator activated="true" class="filter_examples" compatibility="6.4.000" expanded="true" height="103" name="Filter Examples" width="90" x="648" y="85">
    <parameter key="condition_class" value="no_missing_attributes"/>
    <list key="filters_list"/>
    </operator>
    <operator activated="true" breakpoints="after" class="series:windowing" compatibility="5.2.000" expanded="true" height="82" name="Windowing for Training" width="90" x="782" y="85">
    <parameter key="window_size" value="%{WindowSize}"/>
    <parameter key="create_label" value="true"/>
    <parameter key="label_attribute" value="Energy"/>
    <parameter key="horizon" value="%{horizon}"/>
    </operator>
    <operator activated="true" class="vector_linear_regression" compatibility="8.0.001" expanded="true" height="82" name="Vector Linear Regression" width="90" x="983" y="34"/>
    <operator activated="true" class="series:windowing" compatibility="5.2.000" expanded="true" height="82" name="Windowing for Application" width="90" x="916" y="136">
    <parameter key="window_size" value="%{WindowSize}"/>
    <parameter key="label_attribute" value="inputYt"/>
    </operator>
    <operator activated="true" class="extract_macro" compatibility="8.0.001" expanded="true" height="68" name="Extract Example Count" width="90" x="1117" y="136">
    <parameter key="macro" value="exampleCount"/>
    <list key="additional_macros"/>
    </operator>
    <operator activated="true" class="filter_example_range" compatibility="8.0.001" expanded="true" height="82" name="Filter Example Range" width="90" x="1251" y="136">
    <parameter key="first_example" value="%{exampleCount}"/>
    <parameter key="last_example" value="%{exampleCount}"/>
    </operator>
    <operator activated="true" class="remember" compatibility="8.0.001" expanded="true" height="68" name="Remember" width="90" x="1385" y="136">
    <parameter key="name" value="data"/>
    </operator>
    <operator activated="true" class="loop" compatibility="8.0.001" expanded="true" height="82" name="Loop" width="90" x="1117" y="34">
    <parameter key="iterations" value="%{futureYears}"/>
    <process expanded="true">
    <operator activated="true" class="recall" compatibility="8.0.001" expanded="true" height="68" name="Recall" width="90" x="45" y="136">
    <parameter key="name" value="data"/>
    </operator>
    <operator activated="true" class="apply_model" compatibility="7.1.001" expanded="true" height="82" name="Apply Model" width="90" x="179" y="30">
    <list key="application_parameters"/>
    </operator>
    <operator activated="true" class="multiply" compatibility="8.0.001" expanded="true" height="103" name="Multiply" width="90" x="447" y="30"/>
    <operator activated="true" class="materialize_data" compatibility="8.0.001" expanded="true" height="82" name="Materialize Data (2)" width="90" x="179" y="165"/>
    <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="82" name="Increase Date (2)" width="90" x="313" y="165">
    <list key="function_descriptions">
    <parameter key="Year" value="date_add(Year, 1, DATE_UNIT_YEAR)"/>
    </list>
    </operator>
    <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role (2)" width="90" x="447" y="165">
    <parameter key="attribute_name" value="prediction(label)"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="8.0.001" expanded="true" height="82" name="Select Attributes (3)" width="90" x="179" y="289">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="Energy-4"/>
    <parameter key="invert_selection" value="true"/>
    </operator>
    <operator activated="true" class="rename" compatibility="8.0.001" expanded="true" height="82" name="Rename" width="90" x="313" y="289">
    <parameter key="old_name" value="Energy-3"/>
    <parameter key="new_name" value="Energy-4"/>
    <list key="rename_additional_attributes">
    <parameter key="Energy-2" value="Energy-3"/>
    <parameter key="Energy-1" value="Energy-2"/>
    <parameter key="Energy-0" value="Energy-1"/>
    <parameter key="prediction(label)" value="Energy-0"/>
    </list>
    </operator>
    <operator activated="true" class="remember" compatibility="8.0.001" expanded="true" height="68" name="Remember (2)" width="90" x="447" y="289">
    <parameter key="name" value="data"/>
    </operator>
    <connect from_port="input 1" to_op="Apply Model" to_port="model"/>
    <connect from_op="Recall" from_port="result" to_op="Apply Model" to_port="unlabelled data"/>
    <connect from_op="Apply Model" from_port="labelled data" to_op="Multiply" to_port="input"/>
    <connect from_op="Multiply" from_port="output 1" to_port="output 1"/>
    <connect from_op="Multiply" from_port="output 2" to_op="Materialize Data (2)" to_port="example set input"/>
    <connect from_op="Materialize Data (2)" from_port="example set output" to_op="Increase Date (2)" to_port="example set input"/>
    <connect from_op="Increase Date (2)" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
    <connect from_op="Set Role (2)" from_port="example set output" to_op="Select Attributes (3)" to_port="example set input"/>
    <connect from_op="Select Attributes (3)" from_port="example set output" to_op="Rename" to_port="example set input"/>
    <connect from_op="Rename" from_port="example set output" to_op="Remember (2)" to_port="store"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="source_input 2" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="append" compatibility="8.0.001" expanded="true" height="82" name="Append" width="90" x="1251" y="34"/>
    <connect from_op="Read CSV" from_port="output" to_op="Set Predictions_Params" to_port="in 1"/>
    <connect from_op="Set Predictions_Params" from_port="out 1" to_op="Set Role" to_port="example set input"/>
    <connect from_op="Set Role" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
    <connect from_op="Select Attributes" from_port="example set output" to_op="Filter Examples" to_port="example set input"/>
    <connect from_op="Filter Examples" from_port="example set output" to_op="Windowing for Training" to_port="example set input"/>
    <connect from_op="Windowing for Training" from_port="example set output" to_op="Vector Linear Regression" to_port="training set"/>
    <connect from_op="Windowing for Training" from_port="original" to_op="Windowing for Application" to_port="example set input"/>
    <connect from_op="Vector Linear Regression" from_port="model" to_op="Loop" to_port="input 1"/>
    <connect from_op="Windowing for Application" from_port="example set output" to_op="Extract Example Count" to_port="example set"/>
    <connect from_op="Extract Example Count" from_port="example set" to_op="Filter Example Range" to_port="example set input"/>
    <connect from_op="Filter Example Range" from_port="example set output" to_op="Remember" to_port="store"/>
    <connect from_op="Loop" from_port="output 1" to_op="Append" to_port="example set 1"/>
    <connect from_op="Append" from_port="merged set" 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>

    I hope it will be helpful to your project.

     

    Best regards,

     

    Lionel

     

     

     

     

     

     

Answers

  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn

    Hi @cmLs,

     

    Can you share your datasets, please ?

     

    Regards,

     

    Lionel

  • Options
    cmLscmLs Member Posts: 7 Contributor I

    Hello  lionelderkrikor ,

    I attached the labelled and unlabelled data. 

    Excel connot be posted so i post the data as csv. 

    This sample is small but i can send different sample if it is not enough to get future values (1 or 2 years horizon).

    Thank you for the support. 

     

  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn

    Hi again @cmLs,

     

    I have a good new and a bad new : 

     - the good new is that I perform predictions  : 2013,2014, 2015 and 2016 (but you can set the range of years to predict) on the Energy attribute to begin .

    The process can predict only one attribute, not all the attributes together :  I think that you need to train several models to predict all the attributes because they are evolving differently and the process is more complex.

     

     - the bad new is that these predictions are totally fanciful...!

     

    For this process, I don't need of an unlabelled dataset : I make a first prediction from the labeled data, then the prediction become

    the attribute for the next prediction et so on... to sum up all predictions are performed from the labeled dataset.

     

    But how said previously, I used the Vector Linear Regression operator to build the model and the predictions are aberrant and I don't know why ! If someone has an idea.....

    I can't train a Linear Regression or Neural Nets (how you tried) because RapidMiner raise an error.

     

    The process  looks like that : 

    <?xml version="1.0" encoding="UTF-8"?><process version="8.0.001">
    <context>
    <input/>
    <output/>
    <macros>
    <macro>
    <key>futureMonths</key>
    <value>15</value>
    </macro>
    <macro>
    <key>horizon</key>
    <value>1</value>
    </macro>
    <macro>
    <key>windowSize</key>
    <value>6</value>
    </macro>
    </macros>
    </context>
    <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" breakpoints="after" class="read_csv" compatibility="6.0.003" expanded="true" height="68" name="Read CSV" width="90" x="45" y="85">
    <parameter key="csv_file" value="C:\Users\Lionel\Documents\Formations_DataScience\Rapidminer\Tests_Rapidminer\Yıllık Kömür VeriLabelled.csv"/>
    <parameter key="date_format" value="MM/dd/yyyy"/>
    <parameter key="first_row_as_names" value="false"/>
    <list key="annotations">
    <parameter key="0" value="Name"/>
    </list>
    <parameter key="encoding" value="windows-1252"/>
    <list key="data_set_meta_data_information">
    <parameter key="0" value="Yükleme.true.integer.attribute"/>
    <parameter key="1" value="BoÅŸaltma.true.integer.attribute"/>
    <parameter key="2" value="GDP.true.integer.attribute"/>
    <parameter key="3" value="Sanayi endeskis.true.integer.attribute"/>
    <parameter key="4" value="Nufus.true.integer.attribute"/>
    <parameter key="5" value="Energy.true.integer.attribute"/>
    <parameter key="6" value="Year.true.date.attribute"/>
    </list>
    </operator>
    <operator activated="true" class="subprocess" compatibility="8.0.001" expanded="true" height="82" name="Set Predictions_Params" width="90" x="246" y="85">
    <process expanded="true">
    <operator activated="true" class="set_macro" compatibility="8.0.001" expanded="true" height="82" name="Set Window_Size" width="90" x="45" y="34">
    <parameter key="macro" value="WindowSize"/>
    <parameter key="value" value="4"/>
    </operator>
    <operator activated="true" class="set_macro" compatibility="8.0.001" expanded="true" height="82" name="Set Horizon" width="90" x="179" y="34">
    <parameter key="macro" value="horizon"/>
    <parameter key="value" value="2"/>
    </operator>
    <operator activated="true" class="set_macro" compatibility="8.0.001" expanded="true" height="82" name="Set Future_Years" width="90" x="313" y="34">
    <parameter key="macro" value="futureYears"/>
    <parameter key="value" value="6"/>
    </operator>
    <connect from_port="in 1" to_op="Set Window_Size" to_port="through 1"/>
    <connect from_op="Set Window_Size" from_port="through 1" to_op="Set Horizon" to_port="through 1"/>
    <connect from_op="Set Horizon" from_port="through 1" to_op="Set Future_Years" to_port="through 1"/>
    <connect from_op="Set Future_Years" from_port="through 1" to_port="out 1"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="source_in 2" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role" width="90" x="447" y="85">
    <parameter key="attribute_name" value="Year"/>
    <parameter key="target_role" value="id"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="8.0.001" expanded="true" height="82" name="Select Attributes" width="90" x="648" y="85">
    <parameter key="attribute_filter_type" value="subset"/>
    <parameter key="attributes" value="Energy"/>
    </operator>
    <operator activated="true" class="filter_examples" compatibility="6.4.000" expanded="true" height="103" name="Filter Examples" width="90" x="782" y="85">
    <parameter key="condition_class" value="no_missing_attributes"/>
    <list key="filters_list"/>
    </operator>
    <operator activated="true" breakpoints="after" class="series:windowing" compatibility="5.2.000" expanded="true" height="82" name="Windowing for Training" width="90" x="983" y="85">
    <parameter key="window_size" value="%{WindowSize}"/>
    <parameter key="create_label" value="true"/>
    <parameter key="label_attribute" value="Year"/>
    <parameter key="horizon" value="%{horizon}"/>
    </operator>
    <operator activated="true" class="vector_linear_regression" compatibility="8.0.001" expanded="true" height="82" name="Vector Linear Regression" width="90" x="1184" y="34"/>
    <operator activated="true" class="series:windowing" compatibility="5.2.000" expanded="true" height="82" name="Windowing for Application" width="90" x="1184" y="136">
    <parameter key="window_size" value="%{WindowSize}"/>
    <parameter key="label_attribute" value="inputYt"/>
    </operator>
    <operator activated="true" class="extract_macro" compatibility="8.0.001" expanded="true" height="68" name="Extract Example Count" width="90" x="1318" y="136">
    <parameter key="macro" value="exampleCount"/>
    <list key="additional_macros"/>
    </operator>
    <operator activated="true" class="filter_example_range" compatibility="8.0.001" expanded="true" height="82" name="Filter Example Range" width="90" x="1519" y="136">
    <parameter key="first_example" value="%{exampleCount}"/>
    <parameter key="last_example" value="%{exampleCount}"/>
    </operator>
    <operator activated="true" class="remember" compatibility="8.0.001" expanded="true" height="68" name="Remember" width="90" x="1653" y="136">
    <parameter key="name" value="data"/>
    </operator>
    <operator activated="true" class="loop" compatibility="8.0.001" expanded="true" height="82" name="Loop" width="90" x="1318" y="34">
    <parameter key="iterations" value="%{futureYears}"/>
    <process expanded="true">
    <operator activated="true" class="recall" compatibility="8.0.001" expanded="true" height="68" name="Recall" width="90" x="45" y="120">
    <parameter key="name" value="data"/>
    </operator>
    <operator activated="true" class="apply_model" compatibility="7.1.001" expanded="true" height="82" name="Apply Model" width="90" x="179" y="30">
    <list key="application_parameters"/>
    </operator>
    <operator activated="true" class="multiply" compatibility="8.0.001" expanded="true" height="103" name="Multiply" width="90" x="447" y="30"/>
    <operator activated="true" class="materialize_data" compatibility="8.0.001" expanded="true" height="82" name="Materialize Data (2)" width="90" x="179" y="165"/>
    <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="82" name="Increase Date (2)" width="90" x="313" y="165">
    <list key="function_descriptions">
    <parameter key="Year" value="date_add(Year, 1, DATE_UNIT_YEAR)"/>
    </list>
    </operator>
    <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role (2)" width="90" x="447" y="165">
    <parameter key="attribute_name" value="prediction(label)"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="8.0.001" expanded="true" height="82" name="Select Attributes (3)" width="90" x="179" y="289">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="Energy-3"/>
    <parameter key="invert_selection" value="true"/>
    </operator>
    <operator activated="true" class="rename" compatibility="8.0.001" expanded="true" height="82" name="Rename" width="90" x="313" y="300">
    <parameter key="old_name" value="Energy-2"/>
    <parameter key="new_name" value="Energy-3"/>
    <list key="rename_additional_attributes">
    <parameter key="Energy-1" value="Energy-2"/>
    <parameter key="Energy-0" value="Energy-1"/>
    <parameter key="prediction(label)" value="Energy-0"/>
    </list>
    </operator>
    <operator activated="true" class="remember" compatibility="8.0.001" expanded="true" height="68" name="Remember (2)" width="90" x="447" y="300">
    <parameter key="name" value="data"/>
    </operator>
    <connect from_port="input 1" to_op="Apply Model" to_port="model"/>
    <connect from_op="Recall" from_port="result" to_op="Apply Model" to_port="unlabelled data"/>
    <connect from_op="Apply Model" from_port="labelled data" to_op="Multiply" to_port="input"/>
    <connect from_op="Multiply" from_port="output 1" to_port="output 1"/>
    <connect from_op="Multiply" from_port="output 2" to_op="Materialize Data (2)" to_port="example set input"/>
    <connect from_op="Materialize Data (2)" from_port="example set output" to_op="Increase Date (2)" to_port="example set input"/>
    <connect from_op="Increase Date (2)" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
    <connect from_op="Set Role (2)" from_port="example set output" to_op="Select Attributes (3)" to_port="example set input"/>
    <connect from_op="Select Attributes (3)" from_port="example set output" to_op="Rename" to_port="example set input"/>
    <connect from_op="Rename" from_port="example set output" to_op="Remember (2)" to_port="store"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="source_input 2" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="append" compatibility="8.0.001" expanded="true" height="82" name="Append" width="90" x="1519" y="34"/>
    <connect from_op="Read CSV" from_port="output" to_op="Set Predictions_Params" to_port="in 1"/>
    <connect from_op="Set Predictions_Params" from_port="out 1" to_op="Set Role" to_port="example set input"/>
    <connect from_op="Set Role" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
    <connect from_op="Select Attributes" from_port="example set output" to_op="Filter Examples" to_port="example set input"/>
    <connect from_op="Filter Examples" from_port="example set output" to_op="Windowing for Training" to_port="example set input"/>
    <connect from_op="Windowing for Training" from_port="example set output" to_op="Vector Linear Regression" to_port="training set"/>
    <connect from_op="Windowing for Training" from_port="original" to_op="Windowing for Application" to_port="example set input"/>
    <connect from_op="Vector Linear Regression" from_port="model" to_op="Loop" to_port="input 1"/>
    <connect from_op="Windowing for Application" from_port="example set output" to_op="Extract Example Count" to_port="example set"/>
    <connect from_op="Extract Example Count" from_port="example set" to_op="Filter Example Range" to_port="example set input"/>
    <connect from_op="Filter Example Range" from_port="example set output" to_op="Remember" to_port="store"/>
    <connect from_op="Loop" from_port="output 1" to_op="Append" to_port="example set 1"/>
    <connect from_op="Append" from_port="merged set" 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>

    I will continue to search, however I hope that it will be helpful.

     

    Regards,

     

    Lionel

     

    NB : I changed the date format of your labeled dataset (1.1.08 -> 1/1/2008) because I had errors in RapidMiner.(you can find it in attached file).

     

     

     

  • Options
    cmLscmLs Member Posts: 7 Contributor I

    Thank you lionelderkrikor. I am very appreciated for your help. 

    This process helps me very much to proceed with my project. 

    I missed to clarfy the dataset. 

    I wanned to predict only loading attribute.

    And i just want to use other attributes as predictor in the model, is there any way to do this? (maybe with union operator?)

    As you said predictions are very fancifull, i hope with other atttributes if it is possible predictions may be more reasonable. 

    I posted new xml and corrected dataset as you suggest. 

    Thank you again.

    Best Regards

    <?xml version="1.0" encoding="UTF-8"?><process version="7.6.001">
    <context>
    <input/>
    <output/>
    <macros>
    <macro>
    <key>futureMonths</key>
    <value>15</value>
    </macro>
    <macro>
    <key>horizon</key>
    <value>1</value>
    </macro>
    <macro>
    <key>windowSize</key>
    <value>6</value>
    </macro>
    </macros>
    </context>
    <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" breakpoints="after" class="read_csv" compatibility="6.0.003" expanded="true" height="68" name="Read CSV" width="90" x="45" y="85">
    <parameter key="csv_file" value="C:\Users\sony\Desktop\neew.csv"/>
    <parameter key="date_format" value="MM/dd/yyyy"/>
    <parameter key="first_row_as_names" value="false"/>
    <list key="annotations">
    <parameter key="0" value="Name"/>
    </list>
    <parameter key="encoding" value="windows-1252"/>
    <list key="data_set_meta_data_information">
    <parameter key="0" value="Loading.true.integer.attribute"/>
    <parameter key="1" value="Unloading.true.integer.attribute"/>
    <parameter key="2" value="GDP.true.integer.attribute"/>
    <parameter key="3" value="IPI.true.integer.attribute"/>
    <parameter key="4" value="Pop.true.integer.attribute"/>
    <parameter key="5" value="Energy.true.integer.attribute"/>
    <parameter key="6" value="Year.true.date.attribute"/>
    </list>
    </operator>
    <operator activated="true" class="subprocess" compatibility="7.6.001" expanded="true" height="82" name="Set Predictions_Params" width="90" x="246" y="85">
    <process expanded="true">
    <operator activated="true" class="set_macro" compatibility="7.6.001" expanded="true" height="82" name="Set Window_Size" width="90" x="45" y="34">
    <parameter key="macro" value="WindowSize"/>
    <parameter key="value" value="4"/>
    </operator>
    <operator activated="true" class="set_macro" compatibility="7.6.001" expanded="true" height="82" name="Set Horizon" width="90" x="179" y="34">
    <parameter key="macro" value="horizon"/>
    <parameter key="value" value="2"/>
    </operator>
    <operator activated="true" class="set_macro" compatibility="7.6.001" expanded="true" height="82" name="Set Future_Years" width="90" x="313" y="34">
    <parameter key="macro" value="futureYears"/>
    <parameter key="value" value="6"/>
    </operator>
    <connect from_port="in 1" to_op="Set Window_Size" to_port="through 1"/>
    <connect from_op="Set Window_Size" from_port="through 1" to_op="Set Horizon" to_port="through 1"/>
    <connect from_op="Set Horizon" from_port="through 1" to_op="Set Future_Years" to_port="through 1"/>
    <connect from_op="Set Future_Years" from_port="through 1" to_port="out 1"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="source_in 2" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role" width="90" x="447" y="85">
    <parameter key="attribute_name" value="Year"/>
    <parameter key="target_role" value="id"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="7.6.001" expanded="true" height="82" name="Select Attributes" width="90" x="648" y="85">
    <parameter key="attribute_filter_type" value="subset"/>
    <parameter key="attributes" value="Loading"/>
    </operator>
    <operator activated="true" class="filter_examples" compatibility="6.4.000" expanded="true" height="103" name="Filter Examples" width="90" x="782" y="85">
    <parameter key="condition_class" value="no_missing_attributes"/>
    <list key="filters_list"/>
    </operator>
    <operator activated="true" breakpoints="after" class="series:windowing" compatibility="5.2.000" expanded="true" height="82" name="Windowing for Training" width="90" x="983" y="85">
    <parameter key="window_size" value="%{WindowSize}"/>
    <parameter key="create_label" value="true"/>
    <parameter key="label_attribute" value="Year"/>
    <parameter key="horizon" value="%{horizon}"/>
    </operator>
    <operator activated="true" class="vector_linear_regression" compatibility="7.6.001" expanded="true" height="82" name="Vector Linear Regression" width="90" x="1184" y="34"/>
    <operator activated="true" class="series:windowing" compatibility="5.2.000" expanded="true" height="82" name="Windowing for Application" width="90" x="1184" y="136">
    <parameter key="window_size" value="%{WindowSize}"/>
    <parameter key="label_attribute" value="inputYt"/>
    </operator>
    <operator activated="true" class="extract_macro" compatibility="7.6.001" expanded="true" height="68" name="Extract Example Count" width="90" x="1318" y="136">
    <parameter key="macro" value="exampleCount"/>
    <list key="additional_macros"/>
    </operator>
    <operator activated="true" class="filter_example_range" compatibility="7.6.001" expanded="true" height="82" name="Filter Example Range" width="90" x="1519" y="136">
    <parameter key="first_example" value="%{exampleCount}"/>
    <parameter key="last_example" value="%{exampleCount}"/>
    </operator>
    <operator activated="true" class="remember" compatibility="7.6.001" expanded="true" height="68" name="Remember" width="90" x="1653" y="136">
    <parameter key="name" value="data"/>
    </operator>
    <operator activated="true" class="loop" compatibility="7.6.001" expanded="true" height="82" name="Loop" width="90" x="1318" y="34">
    <parameter key="iterations" value="%{futureYears}"/>
    <process expanded="true">
    <operator activated="true" class="recall" compatibility="7.6.001" expanded="true" height="68" name="Recall" width="90" x="45" y="120">
    <parameter key="name" value="data"/>
    </operator>
    <operator activated="true" class="apply_model" compatibility="7.1.001" expanded="true" height="82" name="Apply Model" width="90" x="179" y="30">
    <list key="application_parameters"/>
    </operator>
    <operator activated="true" class="multiply" compatibility="7.6.001" expanded="true" height="103" name="Multiply" width="90" x="447" y="30"/>
    <operator activated="true" class="materialize_data" compatibility="7.6.001" expanded="true" height="82" name="Materialize Data (2)" width="90" x="179" y="165"/>
    <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="82" name="Increase Date (2)" width="90" x="313" y="165">
    <list key="function_descriptions">
    <parameter key="Year" value="date_add(Year, 1, DATE_UNIT_YEAR)"/>
    </list>
    </operator>
    <operator activated="true" class="set_role" compatibility="5.3.013" expanded="true" height="82" name="Set Role (2)" width="90" x="447" y="165">
    <parameter key="attribute_name" value="prediction(label)"/>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="select_attributes" compatibility="7.6.001" expanded="true" height="82" name="Select Attributes (3)" width="90" x="179" y="289">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="Loading-3"/>
    <parameter key="invert_selection" value="true"/>
    </operator>
    <operator activated="true" class="rename" compatibility="7.6.001" expanded="true" height="82" name="Rename" width="90" x="313" y="300">
    <parameter key="old_name" value="Loading-2"/>
    <parameter key="new_name" value="Loading-3"/>
    <list key="rename_additional_attributes">
    <parameter key="Loading-1" value="Loading-2"/>
    <parameter key="Loading-0" value="Loading-1"/>
    <parameter key="prediction(label)" value="Loading-0"/>
    </list>
    </operator>
    <operator activated="true" class="remember" compatibility="7.6.001" expanded="true" height="68" name="Remember (2)" width="90" x="447" y="300">
    <parameter key="name" value="data"/>
    </operator>
    <connect from_port="input 1" to_op="Apply Model" to_port="model"/>
    <connect from_op="Recall" from_port="result" to_op="Apply Model" to_port="unlabelled data"/>
    <connect from_op="Apply Model" from_port="labelled data" to_op="Multiply" to_port="input"/>
    <connect from_op="Multiply" from_port="output 1" to_port="output 1"/>
    <connect from_op="Multiply" from_port="output 2" to_op="Materialize Data (2)" to_port="example set input"/>
    <connect from_op="Materialize Data (2)" from_port="example set output" to_op="Increase Date (2)" to_port="example set input"/>
    <connect from_op="Increase Date (2)" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
    <connect from_op="Set Role (2)" from_port="example set output" to_op="Select Attributes (3)" to_port="example set input"/>
    <connect from_op="Select Attributes (3)" from_port="example set output" to_op="Rename" to_port="example set input"/>
    <connect from_op="Rename" from_port="example set output" to_op="Remember (2)" to_port="store"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="source_input 2" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="append" compatibility="7.6.001" expanded="true" height="82" name="Append" width="90" x="1519" y="34"/>
    <connect from_op="Read CSV" from_port="output" to_op="Set Predictions_Params" to_port="in 1"/>
    <connect from_op="Set Predictions_Params" from_port="out 1" to_op="Set Role" to_port="example set input"/>
    <connect from_op="Set Role" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
    <connect from_op="Select Attributes" from_port="example set output" to_op="Filter Examples" to_port="example set input"/>
    <connect from_op="Filter Examples" from_port="example set output" to_op="Windowing for Training" to_port="example set input"/>
    <connect from_op="Windowing for Training" from_port="example set output" to_op="Vector Linear Regression" to_port="training set"/>
    <connect from_op="Windowing for Training" from_port="original" to_op="Windowing for Application" to_port="example set input"/>
    <connect from_op="Vector Linear Regression" from_port="model" to_op="Loop" to_port="input 1"/>
    <connect from_op="Windowing for Application" from_port="example set output" to_op="Extract Example Count" to_port="example set"/>
    <connect from_op="Extract Example Count" from_port="example set" to_op="Filter Example Range" to_port="example set input"/>
    <connect from_op="Filter Example Range" from_port="example set output" to_op="Remember" to_port="store"/>
    <connect from_op="Loop" from_port="output 1" to_op="Append" to_port="example set 1"/>
    <connect from_op="Append" from_port="merged set" 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>

     

     

     

     

     

  • Options
    cmLscmLs Member Posts: 7 Contributor I

    Hi lionelderkrikor,

    I am studying your suggestions and this process helps me proceed much more rapidly in my project.

    Thank you so much. 

    Best regards

Sign In or Register to comment.