Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Ho to do if multiple variable in rapidminer

Hayashi87Hayashi87 Member Posts: 4 Contributor I
edited November 2018 in Help

Would like to find out how do i go about doing a if condiiton in rapidminer than have a few attributes evaluate to a value.

Eg if (carbrand == '"BMW" OR "AUDI", "CATEGORYACAR", "B")

Answers

  • lionelderkrikorlionelderkrikor RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn

    Hi @Hayashi87,

     

    You can use the Generate Attribute operator : 

    Here the process : 

    <?xml version="1.0" encoding="UTF-8"?><process version="8.1.000">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="8.1.000" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="read_excel" compatibility="8.1.000" expanded="true" height="68" name="Read Excel" width="90" x="112" y="34">
    <parameter key="excel_file" value="C:\Users\Lionel\Documents\Formations_DataScience\Rapidminer\Tests_Rapidminer\If_Or\If_Or.xlsx"/>
    <parameter key="imported_cell_range" value="A1:B10"/>
    <parameter key="first_row_as_names" value="false"/>
    <list key="annotations">
    <parameter key="0" value="Name"/>
    </list>
    <list key="data_set_meta_data_information">
    <parameter key="0" value="Carbrand.true.polynominal.attribute"/>
    <parameter key="1" value="Category.true.attribute_value.attribute"/>
    </list>
    </operator>
    <operator activated="true" class="generate_attributes" compatibility="8.1.000" expanded="true" height="82" name="Generate Attributes" width="90" x="313" y="34">
    <list key="function_descriptions">
    <parameter key="Category" value="if(Carbrand==&quot;BMW&quot;||Carbrand==&quot;Audi&quot;,&quot;A&quot;,&quot;B&quot;)"/>
    </list>
    </operator>
    <connect from_op="Read Excel" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
    <connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>

    Regards, 

     

    Lionel

Sign In or Register to comment.