RapidMiner

RapidMiner

Deleting the Examples according to a condition

Regular Contributor

Deleting the Examples according to a condition

Hi,

I have an example dataset, with 10 variables. Among them, i have two nominal variables, 'cluster' and 'cluster_from_ES2', both taking the values, 'cluster_0', 'cluster_1' and 'cluster_2'. Now, i want to delete the examples (rows), where cluster!=cluster_from_ES2. i.e., I want to retain only the rows when the value of 'cluster' is equal to 'cluster_from_ES2'. How do i do this?

Thanks,
Shubha
3 REPLIES
Regular Contributor

Re: Deleting the Examples according to a condition

Hi,

I used two operators 'AttributeConstruction' and 'ExampleFilter' to do the above task as below:

    <operator name="AttributeConstruction" class="AttributeConstruction">
        <list key="function_descriptions">
          <parameter key="flag" value="if(cluster==cluster_from_ES2,1,0)"/>
        </list>
    </operator>
    <operator name="ExampleFilter" class="ExampleFilter">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="flag=1"/>
    </operator>

But i dont want to use two operators here. I strongly feel that only "ExampleFilter" should take care of the whole. Can I accomplish this task only using 'ExampleFilter'?

Thanks,
Shubha
Regular Contributor

Re: Deleting the Examples according to a condition

Hi,

Is there a better way to do the above?

Thanks,
Shubha
RMStaff

Re: Deleting the Examples according to a condition

No.

Cheers,
Ingo