Hub
  • Software
  • Blog
  • Forum
  • Events
  • Documentation
  • About KNIME
  • KNIME Hub
  • Nodes
  • Java Distance
NodeNode / Manipulator

Java Distance

Analytics Distance Calculation Distance Functions
Drag & drop
Like
Copy short link

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.

Node details

Input ports
  1. Type: Table
    Input table
    Input table.
Output ports
  1. Type: Distance Measure
    Distance Measure
    The defined distance.

Extension

The Java Distance node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
    Extract Fuzzy Clusters
    This workflow shows how XPath nodes can be used to extract cluster information from a PMM…
    alexanderfillbrunn > Public > Data Mining > Clustering > Extract Fuzzy Clusters
  1. Go to item
  2. Go to item
  3. Go to item
  4. Go to item
  5. Go to item
  6. Go to item

KNIME
Open for Innovation

KNIME AG
Hardturmstrasse 66
8005 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • E-Learning course
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • KNIME Open Source Story
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more on KNIME Server
© 2022 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Credits