Deleting the Examples according to a condition

ShubhaShubha Member Posts: 139 Maven
edited November 2018 in Help
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

Answers

  • ShubhaShubha Member Posts: 139 Maven
    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
  • ShubhaShubha Member Posts: 139 Maven
    Hi,

    Is there a better way to do the above?

    Thanks,
    Shubha
  • IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    No.

    Cheers,
    Ingo
Sign In or Register to comment.