Loop Distance Matrix row in java snippet

Dear all,

is it possible to calculate 1.0 - DM with a java snippet in Knime where DM is a distance matrix output from the DistanceMatrix Calculate node?

I seem to have access to the values of the distance matrix but am not able to output the data with a java snippet (of type Double[]) . Someone did something like that already?

I read about the save as DM and re-read with offset workaround, but I wanted something a bit less cumbersome. 


Thanks in advance.



Hello Peter,

   I think you can output as a double array (so create a collection column) and using the distance matrix calculator you can create the distance matrix, at least there is an option like that.

Cheers, gabor

Hi, now I have a java snippet that changes all values in a distance matrix to 1-distance and writes that back to the distance matrix. However, this is output as double[] and not as "Distance Matrix". Thus I cannot use the distance matrix in any subsequent nodes. How to "typecast" the column to Distance?

I don't see how to create a distance matrix from a distance matrix using Distance Matrix Calculate. 


You are right. I was expecting that the Distance Vector distance works on double collections, but only on distance matrices. I have no idea how to solve without custom node (or distance extension).

PS.: What is the use case for Distance Vector distance in the calculator?

I want to cluster the results using the clustering nodes, but these only accept distance matrices as input.