Id attribute

UsernameUsername Member Posts: 39  Guru
edited November 2018 in Help
Hi,

what is the purpose of a id attribute? There's no documentation in the Attributes source file. As far as I understand it can be used by operators which create example sets and which want to assign a unique value to each example to identify an example later by another operator. Id attributes (and "special" attributes in general) are not used by Learners and Models, right?

Thanks

Answers

  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 289  Guru
    Hi User! ;-)

    the Id attribute is indeed not used by learners to build a model since this generally not intended. Hence, the Id attribute is ignored by the learners. On the contrary other special attributes have to be used by learners. The most important special attributes which has to be used by learners (if they implement supervised learning schemes) is the label. Some learners additionally use the potentially present weight attribute (which is also special) to make use of example weights.

    Regards,
    Tobias
  • UsernameUsername Member Posts: 39  Guru
    Thanks for the fast answer!
  • MPReillyMPReilly Member Posts: 1 Contributor I
    I am noticing that only (1) ID attribute per dataset will pass through the model -> apply model -> Write Excel file process.  Can someone confirm this or suggest a workaround that allows multiple ID attributes per dataset to flow through the standard training dataset->model->apply model->write Excel (or csv) file process?  I use (3) ID attributes in original dataset but only (1) survives to the end.  Thanks in advance.
  • T-UnitT-Unit Member Posts: 12 Contributor II
    If I understood the informations in the manual right, you can set only one ID. As far as i know this ID is needed to identify each dataset exactly as unique. Maybe you can change the ID by using the "set attribute"-operator to give another variable the role as the ID, but you can only use one ID in the same time for your dataset. I don' know what you are planing to do but perhaps the label-atrtribute is what you are looking for?

    Regards,
    Thomas
  • awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458   Unicorn
    Hello

    You can use "Set Role" to change the role of an attribute but only one id is allowed at a time. If you want multiple ids, you could set the roles of the ones you want to be id1, id2, id3 and so on. Here's an example
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.2.008">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
        <process expanded="true" height="206" width="346">
          <operator activated="true" class="generate_data" compatibility="5.2.008" expanded="true" height="60" name="Generate Data" width="90" x="80" y="85"/>
          <operator activated="true" class="set_role" compatibility="5.2.008" expanded="true" height="76" name="Set Role" width="90" x="246" y="120">
            <parameter key="name" value="att1"/>
            <parameter key="target_role" value="id"/>
            <list key="set_additional_roles">
              <parameter key="att2" value="id1"/>
              <parameter key="att3" value="id2"/>
            </list>
          </operator>
          <connect from_op="Generate Data" from_port="output" to_op="Set Role" to_port="example set input"/>
          <connect from_op="Set Role" 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

    Andrew
Sign In or Register to comment.