KNN

Processor that builds graph edges by connecting each node to its k nearest neighbors in a coordinate space. It produces the edge index and the corresponding edge weights (neighbor distances).

Configuration

Selected as name: knn.

Option

Description

Type

Default

by

Columns identifying the per-event grouping the graph is built within.

column(s)

required

col

Column holding the per-node coordinates used for neighbor search.

str | int

required

out

Two columns to write: the edge index and the edge weights.

column(s)

required

k

Number of nearest neighbors connected per node.

int

required

- name: knn
  kwargs:
    by: event_id
    col: position
    out: [ edge_index, edge_attr ]
    k: 8