0 ×

Java Distance

KNIME Distance Matrix Extension version 4.3.0.v202011191420 by KNIME AG, Zurich, Switzerland

Enables the definition of arbitrary distance measures using a Java snippet. A distance measure is defined on two equal structured rows. You can refer to a cell value by enclosing the column name prefixed by either row1 or row2 for example $row1.c1$ .

Examples:

Compute the Euclidean distance of the columns c1 and c2 :
sqrt(sqr($row1.c1$-$row2.c1$)+sqr($row1.c2$-$row2.c2$))

Compute the arithmetic mean of the Levenshtein distance of the columns c1 and c2 :
mean(levenshtein($row1.c0$,$row2.c0$),levenshtein($row1.c1$, $row2.c1$))

Note that strings which are part of the expression and are not from the input data (or the result of another wrapped function call) need to be enclosed in double quotes ('"'). Additionally, if the string contains a quote character, it must be escaped using a backslash character ('\"'). Finally, other special characters such as single quotes and backslashes need to be escaped using a backslash. For instance, a single backslash in a string is written as two consecutive backslash characters; the first one acts as the escape character for the second.

Options

Column List
The list contains the column that are available in the input table. Double click any of the column names to insert the respective field in the expression editor. It will replace your current selection or simply insert at the current caret position. Depending on choosing the left or right list the column name is prefixed by the corresponding row identifier.
Flow Variable List
The list contains the flow variables that are currently available at the node input. Double clicking any of the entries will insert the respective identifier at the current cursor position (replacing the selection, if any).
Function
Select a single function to display its description. A double click will insert the function in the expression editor. It will replace your current selection or simply insert at the current caret position. Select a category to narrow down the list of displayed functions.
Expression
The place for your business logic. You can hit ctrl+space to get an auto completion box.

Input Ports

Icon
Input table.

Output Ports

Icon
The defined distance.

Best Friends (Incoming)

Best Friends (Outgoing)

Workflows

Installation

To use this node in KNIME, install KNIME Distance Matrix from the following update site:

KNIME 4.3

A zipped version of the software site can be downloaded here.

You don't know what to do with this link? Read our NodePit Product and Node Installation Guide that explains you in detail how to install nodes to your KNIME Analytics Platform.

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform. Browse NodePit from within KNIME, install nodes with just one click and share your workflows with NodePit Space.

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.