# [SOLVED] Similarity to data: sorting and selecting rows

Hello,

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.

TIA,

Hugo F.

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.

TIA,

Hugo F.

0

## Answers

1,869Unicornmaybe the Transpose operator can help you!

Best regards,

Marius

20Contributor IIThanks 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.

20Contributor IIDid not use the matrix.

For more information see:

http://rapid-i.com/rapidforum/index.php/topic,6212.msg21746.html#msg21746

Hugo F.