Remove Unused Values does not sort if no unused values found

landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
I just noticed that the internal mapping is not sorted as indicated by the parameter "sort alphabetically" of the Remove Unused Values Operator, if there are no unused values.
Reason for that are the following lines of code in the operator:
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (translation.newMapping.size() < attribute.getMapping().size()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (sortMappings) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; translation.newMapping.sortMappings();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; translations.put(attribute.getName(), translation);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }
Obviously the mapping needs to be put into the collection, when the sorting is on OR there is a reduced mapping size. Otherwise the working of the operator depends on the actual given data set which is really hurting in automated scenarios (or when creatively misusing the operator to sort the internal mapping)

1 votes

Fixed and Released · Last Updated



  • Options
    sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
    huh....I have never noticed this checkbox all these years. :smile: OK @land pushing to Prod Feedback.


Sign In or Register to comment.