[SOLVED] Similarity to data: sorting and selecting rows

UgoUgo Member Posts: 20 Contributor II
edited November 2018 in Help

I have used a data set to generate a matrix with the similarity values (using the Similarity to Data operator).
I would like to go through each example and:
1. sort the matrix row
2. select the top k elements

So far I managed to use a "Loop Example" operator to go over each data set line, however
I cannot seem to manage to extract the whole line (all attributes for sorting). How can I do this?
The "Extract Macro" operator seems to require that I indicate a single attribute  :( .

Assuming I can get a data row I am also taking the opportunity to ask:
How do we sort and select the top k elements of a data row?

I have also looked t the "Sort" operator but that seems work on data set columns only.

Hugo F.


  • Options
    MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Hi Hugo,

    maybe the Transpose operator can help you!

    Best regards,
  • Options
    UgoUgo Member Posts: 20 Contributor II
    Hi Marius,

    Thanks for the input. Unfortunately the "transpose" won't work. I have just realized something.
    The matrix output of the "Similarity to Data" operator is _not_ in fact a matrix  ??? .
    The meta data I have is:

    Similarity to Data (2).exampleSet (exampleSet) Meta data: Data Table Number of examples = 0 At most 1 attribute: Generated by:
    ROLE NAME TYPE          RANGE                                                                          MISSING
    id        ID      polynominal ⊇[efl123009c, efls001012, efls001020, efls001040....] = 0

    So even if I could extract all of the line it only has one attribute.
    I expected a matrix wherein the ID is as is above, but I would have all of the range values above as attributes. 
    So my question now is how can I actually get the data row from from the

    Can anyone point out an example that uses the results of "Similarity to Data"?

    Thank you,
    Hugo F.

  • Options
    UgoUgo Member Posts: 20 Contributor II
    Finally took another approach.
    Did not use the matrix.
    For more information see:


    Hugo F.
Sign In or Register to comment.