This is the time series Problem. Where 26 weeks data is provided and we ave to predict next 4 weeks

pallavpallav Member Posts: 21 Contributor II
edited March 26 in Help
In the given problem we have to forecast next 4 weeks of data give past history of past 26 weeks for each client and each product .
We have to forecast  product wise for each client .so ideally in the data four more column(week27,week28,week29,week30) will be added with the forecast result. Attaching dummy data in attachment.

How to do this problem in rapid miner, I tried doing it in rapidminer but was not able to do it . It will be help full  if i can get a demo model of this. I will learn from it and try to implement my problem in rapidminer.
Tagged:

Answers

  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,321  RM Data Scientist
    Hi @pallav ,
    the key operator is called "Multi Horizon Forecast". It allows you to build n-models to predict the n next points. Attached is an example on the german gas station data set. It forecasts the next 6hours of gas station price.
    Best,
    Martin


    <?xml version="1.0" encoding="UTF-8"?><process version="9.6.000">


    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
  • pallavpallav Member Posts: 21 Contributor II
    @mschmitz- I cannot find  attached example 
  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,321  RM Data Scientist
    Hi,
    the XML is in the spoiler.Just click on "show".
    Cheers,
    Martin
    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
  • pallavpallav Member Posts: 21 Contributor II
    @mschmitz - unfortunately i can see any process inside it 
    One one line is there.

  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,321  RM Data Scientist
    Whoops, lets try again

    <?xml version="1.0" encoding="UTF-8"?><process version="9.6.000">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="9.6.000" expanded="true" name="Process">
        <parameter key="logverbosity" value="init"/>
        <parameter key="random_seed" value="2001"/>
        <parameter key="send_mail" value="never"/>
        <parameter key="notification_email" value=""/>
        <parameter key="process_duration_for_mail" value="30"/>
        <parameter key="encoding" value="SYSTEM"/>
        <process expanded="true">
          <operator activated="true" class="retrieve" compatibility="9.6.000" expanded="true" height="68" name="Retrieve Prices of Gas Station" width="90" x="45" y="187">
            <parameter key="repository_entry" value="//Samples/Time Series/data sets/Prices of Gas Station"/>
          </operator>
          <operator activated="true" class="time_series:windowing" compatibility="9.6.000" expanded="true" height="82" name="Windowing" width="90" x="179" y="187">
            <parameter key="attribute_filter_type" value="single"/>
            <parameter key="attribute" value="gas price / euro (times 1000)"/>
            <parameter key="attributes" value=""/>
            <parameter key="use_except_expression" value="false"/>
            <parameter key="value_type" value="attribute_value"/>
            <parameter key="use_value_type_exception" value="false"/>
            <parameter key="except_value_type" value="time"/>
            <parameter key="block_type" value="attribute_block"/>
            <parameter key="use_block_type_exception" value="false"/>
            <parameter key="except_block_type" value="value_matrix_row_start"/>
            <parameter key="invert_selection" value="false"/>
            <parameter key="include_special_attributes" value="false"/>
            <parameter key="has_indices" value="true"/>
            <parameter key="indices_attribute" value="date"/>
            <parameter key="window_size" value="24"/>
            <parameter key="no_overlapping_windows" value="false"/>
            <parameter key="step_size" value="1"/>
            <parameter key="create_horizon_(labels)" value="true"/>
            <parameter key="horizon_attribute" value="gas price / euro (times 1000)"/>
            <parameter key="horizon_size" value="6"/>
            <parameter key="horizon_offset" value="0"/>
            <description align="center" color="transparent" colored="false" width="126">Horizon Size is 6, so we forecast the next 6h&lt;br/&gt;</description>
          </operator>
          <operator activated="true" class="filter_examples" compatibility="9.6.000" expanded="true" height="103" name="Filter Examples" width="90" x="313" y="187">
            <parameter key="parameter_expression" value=""/>
            <parameter key="condition_class" value="custom_filters"/>
            <parameter key="invert_filter" value="false"/>
            <list key="filters_list">
              <parameter key="filters_entry_key" value="Last date in window.lt.01/01/2018 00:00:00 AM"/>
            </list>
            <parameter key="filters_logic_and" value="true"/>
            <parameter key="filters_check_metadata" value="true"/>
            <description align="center" color="transparent" colored="false" width="126">simple split validation</description>
          </operator>
          <operator activated="true" class="time_series:multi_horizon_forecast_learner" compatibility="9.6.000" expanded="true" height="82" name="Multi Horizon Forecast" width="90" x="514" y="85">
            <parameter key="use_default_regular_expression" value="true"/>
            <parameter key="add_macros" value="false"/>
            <parameter key="current_horizon_name_macro" value="current_horizon_attribute"/>
            <parameter key="current_horizon_type_macro" value="current_horizon_type"/>
            <parameter key="enable_parallel_execution" value="true"/>
            <process expanded="true">
              <operator activated="true" class="h2o:generalized_linear_model" compatibility="9.3.001" expanded="true" height="124" name="Generalized Linear Model (2)" width="90" x="45" y="34">
                <parameter key="family" value="AUTO"/>
                <parameter key="link" value="family_default"/>
                <parameter key="solver" value="AUTO"/>
                <parameter key="reproducible" value="false"/>
                <parameter key="maximum_number_of_threads" value="4"/>
                <parameter key="use_regularization" value="true"/>
                <parameter key="lambda_search" value="false"/>
                <parameter key="number_of_lambdas" value="0"/>
                <parameter key="lambda_min_ratio" value="0.0"/>
                <parameter key="early_stopping" value="true"/>
                <parameter key="stopping_rounds" value="3"/>
                <parameter key="stopping_tolerance" value="0.001"/>
                <parameter key="standardize" value="true"/>
                <parameter key="non-negative_coefficients" value="false"/>
                <parameter key="add_intercept" value="true"/>
                <parameter key="compute_p-values" value="false"/>
                <parameter key="remove_collinear_columns" value="false"/>
                <parameter key="missing_values_handling" value="MeanImputation"/>
                <parameter key="max_iterations" value="0"/>
                <parameter key="specify_beta_constraints" value="false"/>
                <list key="beta_constraints"/>
                <parameter key="max_runtime_seconds" value="0"/>
                <list key="expert_parameters"/>
              </operator>
              <connect from_port="training set" to_op="Generalized Linear Model (2)" to_port="training set"/>
              <connect from_op="Generalized Linear Model (2)" from_port="model" to_port="model"/>
              <portSpacing port="source_training set" spacing="0"/>
              <portSpacing port="source_input 1" spacing="0"/>
              <portSpacing port="sink_model" spacing="0"/>
              <portSpacing port="sink_output 1" spacing="0"/>
            </process>
          </operator>
          <operator activated="true" class="apply_model" compatibility="9.6.000" expanded="true" height="82" name="Apply Model" width="90" x="648" y="238">
            <list key="application_parameters"/>
            <parameter key="create_view" value="false"/>
          </operator>
          <operator activated="true" class="time_series:multi_label_performance_evaluator" compatibility="9.6.000" expanded="true" height="124" name="Multi Label Performance" width="90" x="782" y="34">
            <parameter key="auto_detect_label_and_prediction_attributes" value="true"/>
            <parameter key="attribute_filter_type" value="all"/>
            <parameter key="attribute" value=""/>
            <parameter key="attributes" value=""/>
            <parameter key="use_except_expression" value="false"/>
            <parameter key="value_type" value="attribute_value"/>
            <parameter key="use_value_type_exception" value="false"/>
            <parameter key="except_value_type" value="time"/>
            <parameter key="block_type" value="attribute_block"/>
            <parameter key="use_block_type_exception" value="false"/>
            <parameter key="except_block_type" value="value_matrix_row_start"/>
            <parameter key="invert_selection" value="false"/>
            <parameter key="include_special_attributes" value="true"/>
            <parameter key="add_macros" value="false"/>
            <parameter key="current_label_name_macro" value="current_label_attribute"/>
            <parameter key="current_label_type_macro" value="current_label_type"/>
            <parameter key="enable_parallel_execution" value="true"/>
            <process expanded="true">
              <operator activated="true" class="performance_regression" compatibility="9.6.000" expanded="true" height="82" name="Performance" width="90" x="179" y="34">
                <parameter key="main_criterion" value="first"/>
                <parameter key="root_mean_squared_error" value="true"/>
                <parameter key="absolute_error" value="true"/>
                <parameter key="relative_error" value="true"/>
                <parameter key="relative_error_lenient" value="false"/>
                <parameter key="relative_error_strict" value="false"/>
                <parameter key="normalized_absolute_error" value="false"/>
                <parameter key="root_relative_squared_error" value="false"/>
                <parameter key="squared_error" value="false"/>
                <parameter key="correlation" value="false"/>
                <parameter key="squared_correlation" value="false"/>
                <parameter key="prediction_average" value="false"/>
                <parameter key="spearman_rho" value="false"/>
                <parameter key="kendall_tau" value="false"/>
                <parameter key="skip_undefined_labels" value="true"/>
                <parameter key="use_example_weights" value="true"/>
              </operator>
              <connect from_port="labelled set" to_op="Performance" to_port="labelled data"/>
              <connect from_op="Performance" from_port="performance" to_port="performance"/>
              <portSpacing port="source_labelled set" spacing="0"/>
              <portSpacing port="source_input 1" spacing="0"/>
              <portSpacing port="sink_performance" spacing="0"/>
              <portSpacing port="sink_output 1" spacing="0"/>
            </process>
          </operator>
          <connect from_op="Retrieve Prices of Gas Station" from_port="output" to_op="Windowing" to_port="example set"/>
          <connect from_op="Windowing" from_port="windowed example set" to_op="Filter Examples" to_port="example set input"/>
          <connect from_op="Filter Examples" from_port="example set output" to_op="Multi Horizon Forecast" to_port="training set"/>
          <connect from_op="Filter Examples" from_port="unmatched example set" to_op="Apply Model" to_port="unlabelled data"/>
          <connect from_op="Multi Horizon Forecast" from_port="model" to_op="Apply Model" to_port="model"/>
          <connect from_op="Apply Model" from_port="labelled data" to_op="Multi Label Performance" to_port="labelled set"/>
          <connect from_op="Apply Model" from_port="model" to_port="result 3"/>
          <connect from_op="Multi Label Performance" from_port="collection of performances" to_port="result 1"/>
          <connect from_op="Multi Label Performance" from_port="performance" to_port="result 2"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="42"/>
          <portSpacing port="sink_result 3" spacing="105"/>
          <portSpacing port="sink_result 4" spacing="0"/>
        </process>
      </operator>
    </process>




    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
Sign In or Register to comment.