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.
[SOLVED] nested if statements
HI all,
i need help in solving the problem of rapid miner, As i am formulating some rules using nested if. but getting error message.
my rules are as:
two columns: Dtag and Ttag and the result is saved in result column
Ttag Dtag result Column
present past past
present present present
past past past
past present past
future past past
future present future
if(Ttag== “present”, if(Dtag== “past”, “past”, if(Dtag== “present”, “present” , Dtag)),
if(Ttag== “past”, if(Dtag== “past” , “past” , if(Dtag== “present”, “present” , Dtag)),
if(Ttag== “future” , if(Dtag == “past”, “past”, if(Dtag== “present”, “future”, Dtag))))
Kindly help me.
Thanks and Regards:
Sukh
i need help in solving the problem of rapid miner, As i am formulating some rules using nested if. but getting error message.
my rules are as:
two columns: Dtag and Ttag and the result is saved in result column
Ttag Dtag result Column
present past past
present present present
past past past
past present past
future past past
future present future
if(Ttag== “present”, if(Dtag== “past”, “past”, if(Dtag== “present”, “present” , Dtag)),
if(Ttag== “past”, if(Dtag== “past” , “past” , if(Dtag== “present”, “present” , Dtag)),
if(Ttag== “future” , if(Dtag == “past”, “past”, if(Dtag== “present”, “future”, Dtag))))
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.3.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.3.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="6.3.000" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Local Repository/CSVDateTime"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="6.3.000" expanded="true" height="76" name="Generate Attributes" width="90" x="246" y="30">
<list key="function_descriptions">
<parameter key="AA" value="if(Ttag== “present”, if(Dtag== “past”, “past”, if(Dtag== “present”, “present” , Dtag)), if(Ttag== “past”, if(Dtag== “past” , “past” , if(Dtag== “present”, “present” , Dtag)), if(Ttag== “future” , if(Dtag == “past”, “past”, if(Dtag== “present”, “future”, Dtag))))"/>
</list>
</operator>
<connect from_op="Retrieve" 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>
Kindly help me.
Thanks and Regards:
Sukh
0
Answers
Scott
One way to make it easier to calculate them on RapidMiner is to chain them together as the Generate Attributes operator calculates each expression in series.
See this as an example.
you can use nested if functions without problems, however when using such highly nested ones, you must absolutely make sure each function consists of the 3 different parts: The condition, the result for condition = true and the result for condition = false. Your expression does not do that, you have multiple if expressions left which do not consist of these 3 parts.
Simple example: Regards,
Marco
I have tried using generate attribute with series of expressions, it worked accordingly.
Thanks alot.
Regards:
Sukh