Options

discrete attribute that indicates the age

heheehehee Member Posts: 4 Newbie
Hello!

My query is ..
How can I get to the following:

"Generate a new discrete attribute that indicates the age of the
people as of August 8, 1934 "

The above, taking into account that:

DOB are represented in the table as:

August 18, 1990

Help pls

Answers

  • Options
    VanlalVanlal Member Posts: 12 Contributor II
    Hi

    <div><?xml version="1.0" encoding="UTF-8"?><process version="9.6.000"></div><div>&nbsp; <context></div><div>&nbsp; &nbsp; <input/></div><div>&nbsp; &nbsp; <output/></div><div>&nbsp; &nbsp; <macros/></div><div>&nbsp; </context></div><div>&nbsp; <operator activated="true" class="process" compatibility="9.4.000" expanded="true" name="Process" origin="GENERATED_TUTORIAL"></div><div>&nbsp; &nbsp; <parameter key="logverbosity" value="init"/></div><div>&nbsp; &nbsp; <parameter key="random_seed" value="2001"/></div><div>&nbsp; &nbsp; <parameter key="send_mail" value="never"/></div><div>&nbsp; &nbsp; <parameter key="notification_email" value=""/></div><div>&nbsp; &nbsp; <parameter key="process_duration_for_mail" value="30"/></div><div>&nbsp; &nbsp; <parameter key="encoding" value="SYSTEM"/></div><div>&nbsp; &nbsp; <process expanded="true"></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="retrieve" compatibility="9.6.000" expanded="true" height="68" name="Retrieve Age" width="90" x="45" y="136"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="repository_entry" value="../data/Age"/></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="generate_attributes" compatibility="9.6.000" expanded="true" height="82" name="Generate Attributes (2)" width="90" x="179" y="136"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <list key="function_descriptions"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <parameter key="DiscreteAgeDividedbyDay" value="date_diff(date_parse(&quot;8/8/1934&quot;),DOB)/8.64e+7/365"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; </list></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="keep_all" value="true"/></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Retrieve Age" from_port="output" to_op="Generate Attributes (2)" to_port="example set input"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Generate Attributes (2)" from_port="example set output" to_port="result 1"/></div><div>&nbsp; &nbsp; &nbsp; <portSpacing port="source_input 1" spacing="0"/></div><div>&nbsp; &nbsp; &nbsp; <portSpacing port="sink_result 1" spacing="0"/></div><div>&nbsp; &nbsp; &nbsp; <portSpacing port="sink_result 2" spacing="0"/></div><div>&nbsp; &nbsp; &nbsp; <background height="232" location="//Samples/Tutorials/Data Handling/05/tutorial5" width="1502" x="26" y="47"/></div><div>&nbsp; &nbsp; </process></div><div>&nbsp; </operator></div><div></process></div>

    The sample data i used is 
    Name DOB
    Albert 11/8/1990
    John 11/4/1991
    Carin 12/3/1992
    Hulk 9/4/1992


  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Use the "date_diff" function within Generate Attributes and that should give you what you need.

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
Sign In or Register to comment.