"[SOLVED] Macros and the Sort operator"

kiribati
kiribati New Altair Community Member
edited November 5 in Community Q&A
Hi, I'm using RapidMiner 5.3 (64 bit version) on Windows 7.

Is there any way to sort a data set by a macro operator? I would like to sort a data set based on the increasing value of an attribute, with the name of the attribute being stored in a macro. I do not see the macro in the attribute name drop down box for the Sort operator, so I typed the macro name into the attribute name box for the Sort operator and hit the play button for the process to run.

However, the process fails with the message "No attribute selected. Select an attribute by clicking on the 'attribute name' drop-down box" Offending operator:Sort

Is there any other way to sort or extract the top x examples in a data set by a increasing/decreasing macro?

Answers

  • MariusHelf
    MariusHelf New Altair Community Member
    Hi,

    the error message is a bit misleading, this "no attribute selected" also appears if an invalid attribute name is entered. To use the value of a macro you have to surround the macro name with percent and curly braces, like this: %{myMacro}. In all parameters this will deliver the value of the macro. To check if the macro is correctly set you can use a breakpoint before the Sort operator and activate the Macro View under Help -> View -> Macros.

    Best regards,
    Marius
  • kiribati
    kiribati New Altair Community Member
    Thanks, Marius. Your answer helped.

    I suggest that we fix the misleading error message - and log this in RapidMiner's bug/feature request tracking system, if this hasn't already been done.

    Regards,
    Kiribati
  • MariusHelf
    MariusHelf New Altair Community Member
    Yes, the issue is already in our internal bugtracker.

    Best regards,
    Marius