fused_butina#
- nvmolkit.clustering.fused_butina(
- x: AsyncGpuResult | Tensor | ndarray,
- cutoff: float,
- metric: Literal['tanimoto', 'cosine', 'aap'] | TanimotoMetric | CosineMetric | AAPMetric = 'tanimoto',
- stream: Stream | None = None,
- *,
- output: Literal[OutputMode.DEVICE] = OutputMode.DEVICE,
- nvmolkit.clustering.fused_butina(
- x: AsyncGpuResult | Tensor | ndarray,
- cutoff: float,
- metric: Literal['tanimoto', 'cosine', 'aap'] | TanimotoMetric | CosineMetric | AAPMetric = 'tanimoto',
- stream: Stream | None = None,
- *,
- output: Literal[OutputMode.RDKIT],
Perform Butina clustering on fingerprints, computing distances as needed.
Equivalent to
butina()on the matrix of1 - similarityvalues, without forming theN x Nmatrix.- Parameters:
x – Packed int32 or uint32 fingerprints of shape
(N, num_words). Can be an AsyncGpuResult, torch.Tensor, or numpy.ndarray. CPU tensors and NumPy arrays are copied to CUDA.cutoff – Inclusive neighbor distance in
[0, 1].metric – Similarity metric.
AAPMetricis not yet supported.stream – CUDA stream to use. If None, uses the current stream.
output – Result representation.
- Returns:
A
ClusterDeviceResultforOutputMode.DEVICE, or the centroid-first cluster tuples returned by RDKit’sButina.ClusterDataforOutputMode.RDKIT.