fused_dise#

nvmolkit.clustering.fused_dise(
x,
cutoff: float,
*,
metric: Literal['tanimoto', 'cosine', 'aap'] | TanimotoMetric | CosineMetric | AAPMetric = 'tanimoto',
assignment: Literal['first', 'nearest'] = 'nearest',
stream: Stream | None = None,
output: OutputMode = OutputMode.DEVICE,
) → ClusterDeviceResult | tuple[tuple[int, ...], ...]#

Cluster by directed sphere exclusion (DISE), computing distances as needed.

Equivalent to dise() on the matrix of 1 - similarity values, with memory that scales as O(N). Distances are computed in float32, so results can differ slightly from RDKit’s double-precision results.

Parameters:
  • x – Packed int32 or uint32 fingerprints of shape (N, num_words) for Tanimoto and cosine, or a sequence of RDKit molecules for AAP.

  • cutoff – Inclusive exclusion distance in [0, 1], rounded to float32.

  • metric – Similarity metric.

  • assignment – "first" or "nearest".

  • stream – CUDA stream to use. If None, uses the current stream.

  • output – Result representation.

Returns:

A ClusterDeviceResult for OutputMode.DEVICE, or centroid-first tuples of input indices for OutputMode.RDKIT.

Note

For the method, see Gobbi et al. (2015).