Pages: [1]
  Print  
Author Topic: [SOLVED] Converting Numerical to Nominal data types, with content replaced  (Read 520 times)
transformers123
Newbie
*
Posts: 7


« on: September 18, 2013, 07:27:39 PM »

Hello All,
I'm new to RapidMiner and while I was experimenting with it, I was not sure of how to do the following process....

I'm making use of Golf Data in Samples provided.
I want to convert the temperature & humidity to nominal form i.e.,
temp <=75 => cool
temmp > 75 and temp <= 85 => medium
temp > 85 hot
similarly with humidity.
i tried to use the numerical to nominal option, but it doesn't seem to work that way.
Is there an option to use?
Thanks in advance.
« Last Edit: September 21, 2013, 06:27:13 PM by transformers123 » Logged
Marco Boeck
Administrator
Hero Member
*****
Posts: 914


WWW
« Reply #1 on: September 20, 2013, 08:58:09 AM »

Hi,

you can use the "Generate Attributes" operator for that. Because you are changing a numerical attribute to a nominal one, you cannot overwrite the same attribute, so you have to create a new one. The old one could be removed via "Select Attributes". See the following example process:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.013">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve Golf" width="90" x="45" y="30">
        <parameter key="repository_entry" value="//Samples/data/Golf"/>
      </operator>
      <operator activated="true" class="generate_attributes" compatibility="5.3.013" expanded="true" height="76" name="Generate Attributes" width="90" x="179" y="30">
        <list key="function_descriptions">
          <parameter key="Temperature_Nominal" value="if (Temperature&lt;=75, &quot;cool&quot;, if (Temperature&gt;=85, &quot;hot&quot;, &quot;medium&quot;))"/>
        </list>
      </operator>
      <connect from_op="Retrieve Golf" 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,
Marco
Logged

transformers123
Newbie
*
Posts: 7


« Reply #2 on: September 21, 2013, 03:54:26 AM »

Cool... That Helped.
Thanks  Smiley
Logged
Pages: [1]
  Print  
 
Jump to: