[SOLVED] Controlling map order of nominal values

tennenrishin
tennenrishin New Altair Community Member
edited November 5 in Community Q&A
A "map order" is alluded to in the tooltip of the "sort alphabetically" parameter of the Removed Unused Values operator.

Premise 1:
A set of nominal values has an inherent "map order".

Premise2:
This "map order" determines the sequence in which elements are arranged on a chart axis, when a nominal attribute is selected for that axis (e.g. bubble chart with nominal x-axis attribute).

Question1:
Are the premises above correct?

Question2:
Other than the "sort alphabetically" mechanism of the Remove Unused Values Operator, are there any ways to control the "map order"? (...in order to control subsequent chart axis order for nominal attributes.)

Answers

  • MariusHelf
    MariusHelf New Altair Community Member
    Hi,

    in RapidMiner, nominal values are represented internally as integer values which are mapped to strings during display and model creation etc. This is for reducing the memory consumption, since instead of storing over and over again the same (probably long) strings, storing just numbers and a mapping usually leaves a smaller memory footprint.

    When RapidMiner reads data, it maps the first string in a column to "0", the second one to "1" etc. So the only possibility to control the ordering of the mapping is by ordering your input data. Btw, if you are using the new "adavanced charts" instead of the "plot view", nominal values are always sorted alphabetically.

    Best,
      Marius
  • tennenrishin
    tennenrishin New Altair Community Member
    Thank you!

    Are there plans to support advanced charts in the reporting extension in the near future?
  • MariusHelf
    MariusHelf New Altair Community Member
    Unfortunately, this is currently not at the head of our TODO list.
  • BartN
    BartN New Altair Community Member
    HI Marius,

    Is it possible In Advanced Charts to plot multiple binomial values on the Nominal axis?
    The error message "Mixed nominal values on axis ... All nominal series configurations on an axis must refer to the.same nominal mapping..." suggests this.

    I have to two binominal attributes with value range {true, false}, used the "Remap Binomials" to define false as negative and true as positive, but that does not result in the same nominal mapping.

    Thanks,
    Bart
  • MariusHelf
    MariusHelf New Altair Community Member
    Hi,

    if I remember correctly, that is not possible, even if the message implies that. However, you can create a second binominal axis. That is certainly less than optimal, but at least it will bring you multiple nominal attributes into the chart.

    Best, Marius
  • tennenrishin
    tennenrishin New Altair Community Member
    For anyone else who needs this in future:

    One way to reorder nominal values is to reorder the exampleset, and then perform a trivial (i.e. identity) Generate Attributes operation on the attribute in question.

    In the example below, compare eg x vs x scatter chart of the two outputs.
    <?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="641" width="1048">
         <operator activated="true" class="generate_data_user_specification" compatibility="5.2.008" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="244" y="102">
           <list key="attribute_values">
             <parameter key="x" value="&quot;b&quot;"/>
           </list>
           <list key="set_additional_roles"/>
         </operator>
         <operator activated="true" class="generate_data_user_specification" compatibility="5.2.008" expanded="true" height="60" name="Generate Data by User Specification (2)" width="90" x="246" y="210">
           <list key="attribute_values">
             <parameter key="x" value="&quot;a&quot;"/>
           </list>
           <list key="set_additional_roles"/>
         </operator>
         <operator activated="true" class="append" compatibility="5.2.008" expanded="true" height="94" name="Append" width="90" x="514" y="165"/>
         <operator activated="true" class="sort" compatibility="5.2.008" expanded="true" height="76" name="Sort" width="90" x="648" y="165">
           <parameter key="attribute_name" value="x"/>
         </operator>
         <operator activated="true" class="generate_attributes" compatibility="5.2.008" expanded="true" height="76" name="Generate Attributes" width="90" x="782" y="165">
           <list key="function_descriptions">
             <parameter key="x" value="x"/>
           </list>
         </operator>
         <connect from_op="Generate Data by User Specification" from_port="output" to_op="Append" to_port="example set 1"/>
         <connect from_op="Generate Data by User Specification (2)" from_port="output" to_op="Append" to_port="example set 2"/>
         <connect from_op="Append" from_port="merged set" to_op="Sort" to_port="example set input"/>
         <connect from_op="Sort" from_port="example set 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="126"/>
         <portSpacing port="sink_result 2" spacing="0"/>
         <portSpacing port="sink_result 3" spacing="0"/>
       </process>
     </operator>
    </process>