How to use SeriesPrediction operator?

RyujakkRyujakk Member Posts: 17  Maven
edited November 2018 in Help
Hello,

I'm currently playing around with the Value Series plugin. I want to plot on a single graph the real values of my series, as well as the predicted values. To do this, the SeriesPrediction operator seemed adequate. However, I have trouble setting it up correctly. From what I understood of its description, it should take as inner operator a Learner, like in the following process:
<operator name="Root" class="Process" expanded="yes">
    <parameter key="logverbosity" value="error"/>
    <operator name="GenerateSinusLikeSeries" class="OperatorChain" expanded="no">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="simple sinus"/>
            <parameter key="number_of_attributes" value="1"/>
        </operator>
        <operator name="Sorting" class="Sorting">
            <parameter key="attribute_name" value="att1"/>
        </operator>
        <operator name="AttributeFilter" class="AttributeFilter">
            <parameter key="condition_class" value="attribute_name_filter"/>
            <parameter key="parameter_string" value="label"/>
        </operator>
    </operator>
    <operator name="SeriesPrediction" class="SeriesPrediction" expanded="yes">
        <parameter key="horizon" value="2"/>
        <operator name="LibSVMLearner" class="LibSVMLearner">
            <parameter key="svm_type" value="nu-SVR"/>
            <list key="class_weights">
            </list>
        </operator>
    </operator>
</operator>
But this fails with the following error:
Error in: LibSVMLearner (LibSVMLearner) The input example set has less than 2 examples. Some operators need a minimum number of examples. Please check the input files or the experiment setup if this minimum number should be provided by your dataset.
The way I got it to "work" was to use a model as an inner operator, likewise:
<operator name="Root" class="Process" expanded="yes">
    <parameter key="logverbosity" value="error"/>
    <operator name="GenerateSinusLikeSeries" class="OperatorChain" expanded="no">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="simple sinus"/>
            <parameter key="number_of_attributes" value="1"/>
        </operator>
        <operator name="Sorting" class="Sorting">
            <parameter key="attribute_name" value="att1"/>
        </operator>
        <operator name="AttributeFilter" class="AttributeFilter">
            <parameter key="condition_class" value="attribute_name_filter"/>
            <parameter key="parameter_string" value="label"/>
        </operator>
    </operator>
    <operator name="IOMultiplier" class="IOMultiplier">
        <parameter key="io_object" value="ExampleSet"/>
    </operator>
    <operator name="ChangeAttributeRole" class="ChangeAttributeRole">
        <parameter key="name" value="label"/>
    </operator>
    <operator name="Series2WindowExamples" class="Series2WindowExamples">
        <parameter key="series_representation" value="encode_series_by_examples"/>
        <parameter key="horizon" value="2"/>
        <parameter key="window_size" value="10"/>
    </operator>
    <operator name="LibSVMLearner" class="LibSVMLearner">
        <parameter key="svm_type" value="nu-SVR"/>
        <list key="class_weights">
        </list>
    </operator>
    <operator name="IOStorer" class="IOStorer">
        <parameter key="name" value="myModel"/>
        <parameter key="io_object" value="Model"/>
    </operator>
    <operator name="SeriesPrediction" class="SeriesPrediction" expanded="yes">
        <parameter key="horizon" value="2"/>
        <operator name="OperatorChain" class="OperatorChain" expanded="yes">
            <operator name="IORetriever" class="IORetriever">
                <parameter key="name" value="myModel"/>
                <parameter key="io_object" value="Model"/>
                <parameter key="remove_from_store" value="false"/>
            </operator>
            <operator name="ModelApplier" class="ModelApplier">
                <parameter key="keep_model" value="true"/>
                <list key="application_parameters">
                </list>
            </operator>
        </operator>
    </operator>
</operator>
However, this technique is in contradiction with the SeriesPrediction's description, and seems a bit complicated!

Soooo, how am I supposed to use this operator in the "right" way? Would you have an example process I could refer to?

Thanks in advance for your help!

- R

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,529   Unicorn
    Hi,
    the problem is, that SeriesPrediction does not build the same example set as Series2WindowExamples does. Use breakpoints and take a look at the attribute names. Because of this, the model does not find the same attributes and doesn't predict at all.

    But you could do it this way:
    <operator name="Root" class="Process" expanded="yes">
        <parameter key="logverbosity" value="error"/>
        <operator name="GenerateSinusLikeSeries" class="OperatorChain" expanded="yes">
            <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
                <parameter key="target_function" value="simple sinus"/>
                <parameter key="number_of_attributes" value="1"/>
            </operator>
            <operator name="Sorting" class="Sorting">
                <parameter key="attribute_name" value="att1"/>
            </operator>
            <operator name="AttributeFilter" class="AttributeFilter">
                <parameter key="condition_class" value="attribute_name_filter"/>
                <parameter key="parameter_string" value="label"/>
            </operator>
        </operator>
        <operator name="IOMultiplier" class="IOMultiplier">
            <parameter key="io_object" value="ExampleSet"/>
        </operator>
        <operator name="ChangeAttributeRole" class="ChangeAttributeRole">
            <parameter key="name" value="label"/>
        </operator>
        <operator name="MultivariateSeries2WindowExamples" class="MultivariateSeries2WindowExamples">
            <parameter key="window_size" value="10"/>
            <parameter key="label_attribute" value="label"/>
        </operator>
        <operator name="WindowExamples2ModelingData" class="WindowExamples2ModelingData">
            <parameter key="label_name_stem" value="label"/>
            <parameter key="horizon" value="2"/>
        </operator>
        <operator name="LibSVMLearner" class="LibSVMLearner">
            <parameter key="keep_example_set" value="true"/>
            <parameter key="svm_type" value="nu-SVR"/>
            <list key="class_weights">
            </list>
        </operator>
        <operator name="ModelApplier" class="ModelApplier">
            <parameter key="keep_model" value="true"/>
            <list key="application_parameters">
            </list>
        </operator>
        <operator name="WindowExamples2OriginalData" class="WindowExamples2OriginalData">
        </operator>
    </operator>
    Greetings,
    Sebastian
  • RyujakkRyujakk Member Posts: 17  Maven
    Thank you Sebastian!

    This works just great  :)

    As always, a rapid and precise response!

    - R
Sign In or Register to comment.