Problems with the Generate Attributes operator

Mark_KnechtMark_Knecht Member Posts: 10 Contributor II
edited November 2018 in Help
Hi,
  I've been trying to use the Generate Attributes operator to do some simple math. It's use is shown in the Tutorial - Step 19 or 26 - and it looks so simple, but for me it's not working.

1) I drag the operator onto my process page. The first problem is minor: In the tutorial the title banner shows 'Generation' while in my process it says Generate Attributes. I'm going to assume that maybe this is caused by old code in the tutorials or something like that and that the difference isn't part of my problem. The Help data for both says Generate Attributes so am I using the right operator?

2) My first bigger problem comes when I select Edit List. When I add an entry I get a new line but I only seem to be able to type in the box on the left. Nothing gets me over to the box on the right. Platform is Win 7 64-bit Professional if it matters.

3) Since I cannot get to the right hand box I close the editor and edit a second time. This time I can select the box on the right and type an equation. So far so good, except...

4) When I try to run my process I don't get the attribute I created and the next time I try to edit here I see everything on the right has been deleted.

I suspect I can probably add the equations by hand in the XML but I'd like to use the editor if possible.

Cheers,
Mark

Here's a very simple example. Even in the resulting XML I can see the parameter code is missing

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.0">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" expanded="true" name="Process">
    <process expanded="true" height="540" width="622">
      <operator activated="true" class="read_excel" expanded="true" height="60" name="Read Excel" width="90" x="112" y="120">
        <parameter key="excel_file" value="C:\RapidMinerData\F1.xls"/>
        <list key="annotations"/>
      </operator>
      <operator activated="true" class="generate_attributes" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="120">
        <list key="function_descriptions"/>
      </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"/>
      <connect from_op="Generate Attributes" from_port="original" to_port="result 2"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="180"/>
      <portSpacing port="sink_result 3" spacing="0"/>
    </process>
  </operator>
</process>

Answers

  • SebastianLohSebastianLoh Member Posts: 99  Maven
    Hi Mark,

    as you already expririenced a couple of times, yes the tutorial is a little bit behind the recent developments of RapidMiner 5. Sorry for that.

    I tried to generate an attribut (see process below). When I klick on the Edit List button of the Generated Attribut operator I can add a new rentry. Then I set the new attribute's name by double clicking in the left side and define the attribute fuction by double clicking in the right field. I admit this double click is not the expected behavior for a text field.

    Finish the dialog with the OK button and then it should be fine.

    I hope I could help.

    Ciao Sebastian

    P.S. the German manual is out: http://rapid-i.com/rapidforum/index.php/topic,2003.0.html
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" expanded="true" name="Process">
       <process expanded="true" height="412" width="574">
         <operator activated="true" class="retrieve" expanded="true" height="60" name="Retrieve" width="90" x="28" y="83">
           <parameter key="repository_entry" value="//Samples/data/Sonar"/>
         </operator>
         <operator activated="true" class="generate_attributes" expanded="true" height="76" name="Generate Attributes" width="90" x="246" y="120">
           <list key="function_descriptions">
             <parameter key="new_attribute" value="attribute_1 + attribute_2"/>
           </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>
Sign In or Register to comment.