RapidMiner

RapidMiner

How to use ExampleFilter or ExampleRangeFilter

amy
Regular Contributor

How to use ExampleFilter or ExampleRangeFilter

Hi there,
I have an ExampleSet eset now and also I have selected some examples out of it such as e1, e2, e3, e4, e5.
How can I separate eset into two parts, one ExampleSet just includes  e1, e2, e3, e4, e5, and the other has the left in it?
Should I use ExampleFilter? I have looked at it. But I don't know how to use it.
I use RapidMiner in java not with the GUI interface.
Another question is if I have a double[] which has the same structure as e1, e2 etc., how can I add the double[] to eset.
Thanks a lot.
2 REPLIES
Regular Contributor

Re: How to use ExampleFilter or ExampleRangeFilter

Hello amy

For this case, you need to double the ExampleSet and apply ExampleFilter twice.
Example:
<operator name="Root" class="Process" expanded="yes">
    <operator name="ExampleSource" class="ExampleSource">
        <parameter key="attributes" value="iris.aml"/>
    </operator>
    <operator name="IOMultiplier" class="IOMultiplier">
        <parameter key="io_object" value="ExampleSet"/>
    </operator>
    <operator name="ExampleFilter" class="ExampleFilter">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="a1&gt;5"/>
    </operator>
    <operator name="IOSelector" class="IOSelector">
        <parameter key="io_object" value="ExampleSet"/>
        <parameter key="select_which" value="2"/>
    </operator>
    <operator name="ExampleFilter (2)" class="ExampleFilter">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="invert_filter" value="true"/>
        <parameter key="parameter_string" value="a1&gt;5"/>
    </operator>
</operator>



Another question is if I have a double[] which has the same structure as e1, e2 etc., how can I add the double[] to eset.

I suggest this: Create an ExampleSet representing your double[] and then apply the ExampleSetMerge-Operator. 
In case you think this is complicated: The inner structure of ExampleSet named ExampleTable, which stores the data (note that ExampleSet is just a view on ExampleTable), is not meant to be changed easily (e.g. by adding data). This seems to be a disadvantage, but in fact this is one the reasons why RapidMiner is fast.

hope this was helpful,

Steffen

amy
Regular Contributor

Re: How to use ExampleFilter or ExampleRangeFilter

Hi Steffen,
Thank you very much. Especially the idea about ExampleSet and ExampleTable.

Regards

Amy