50k" or "<=50k". I want to generate an attribue status such..." /> 50k" or "<=50k". I want to generate an attribue status such..." /> 50k" or "<=50k". I want to generate an attribue status such..."/>

rapidminer if else statement for attribute generation

3.9k views Asked by At

I have a csv file adult dataset from UCI. I have an incom attribute whose values are ">50k" or "<=50k". I want to generate an attribue status such that:

if incom=">50k" status="yes" else status="no"

I am not a rapidminer user neither rm have any doc. about this. I have used these statements:

if ( incom == ">50k") status = "yes" else status="no";
if (matches(incom,">50k")) status ="yes" else status="no";

and many other. but it says

implicit multiplication not enabled

how to tackle the problem? Rm allowed to write in single line as you know so the code above is not indented. Thanks

2

There are 2 answers

0
Andrew Chisholm On BEST ANSWER

The Generate Attributes operator lets you create a new attribute with the following tiny bit of "code".

if (incom == ">50k", "yes", "no")

In more detail, in the parameter list of the Generate Attributes operator, set the attribute name to be the name of the new attribute you want to create - status for example. Then set the function expression to be the expression above.

0
Malhelo On

Another way to get a binominal (boolean) status attribute would be to

  1. Generate a copy of the income attribute with the name status (Generate Copy)
  2. Map numeric to binominal of this status attribute (Numerical to Binominal) with min=0.0 and max=50000