Skip to main content

HDBSCAN

SQL function: cuml_hdbscan

Official cuML reference: Python API

cuML HDBSCAN fits density-based clusters and returns query-local labels and membership probabilities.

Quickstart

Register the relations referenced by the parenthesized SELECT clauses below. For metadata validation, the descriptor names input_vectors.

SELECT id, cluster_id, probability FROM cuml_hdbscan(input => (SELECT id, d0, d1 FROM t), min_cluster_size => 5) ORDER BY row_ordinal;

Inputs

Each relation argument is a parenthesized SELECT subquery. Metadata validation resolves a registered table or view for the same role without scanning its rows. See ML Inputs for the ID, Float32 feature, null, finite-value, and runtime-dimension contract.

RoleRequiredValidation referenceDescription
inputyestableDense Float32 rows fitted and transformed in this statement.

Vector element types

Element typeValid metrics
Float32Not applicable

Arguments and options

Scalar SQL arguments

ArgumentTypeRequiredDescription
min_samplesintegernoMinimum samples in a core-distance neighborhood.
min_cluster_sizeintegernoMinimum size of a selected cluster.
max_cluster_sizeintegernoMaximum cluster size; zero disables the bound.
cluster_selection_epsilonnumbernoNonnegative threshold for cluster selection.
alphanumbernoPositive mutual-reachability distance scale.
allow_single_clusterbooleannoAllow one cluster to cover all input rows.
cluster_selection_methodenum ("eom", "leaf")noSelect clusters by excess of mass or leaf nodes.

SQL value argument schemas

ArgumentRequiredLiteral shapeDefaultConstraintsDescription
allow_single_clusternobooleanfalseAllow one cluster to cover all input rows.
alphanonumber1greater than 0Positive mutual-reachability distance scale.
cluster_selection_epsilonnonumber0minimum 0Nonnegative threshold for cluster selection.
cluster_selection_methodnostring"eom"one of "eom", "leaf"Select clusters by excess of mass or leaf nodes.
max_cluster_sizenointeger0minimum 0; maximum 2147483647Maximum cluster size; zero disables the bound.
min_cluster_sizenointeger5minimum 2; maximum 2147483647Minimum size of a selected cluster.
min_samplesnointeger5minimum 1; maximum 2147483647Minimum samples in a core-distance neighborhood.

Vector binding shapes

Each relation subquery projects a non-null id and either non-null Float32 feature columns in dimension order or one non-null vector list column of non-null Float32 values. For classification, training also projects non-null Int32 label; regression requires non-null finite Float32 label. The predict relation omits it.

The list-column shape excludes other feature columns. See ML Inputs for the allowed list containers and runtime checks.

Output

ColumnTypeNullableDescription
row_ordinalUInt64noEvaluated input row position, including when IDs repeat.
idsame_as_input.idnoLogical input ID.
cluster_idInt64noSelected cluster ID; -1 indicates noise.
probabilityFloat32noMembership probability for the selected cluster.

Concrete schemas are call-specific. Run gpu_validate_call against registered relations to inspect the output schema after the actual ID types and literal options are validated.

Limits

  • Validation resolves named tables or views and reads schemas only; it does not execute relation scans or GPU work.
  • Execution relation arguments require parenthesized subqueries; dry-run validation accepts registered named relations only.
  • Only Float32 features are supported; L2SqrtExpanded distance and brute-force kNN are fixed.
  • Empty input returns an empty result. Other inputs require min_samples < rows, min_cluster_size <= rows, and max_cluster_size <= rows; row-dependent conditions are checked at execution.
  • Cluster ID -1 denotes noise. The fit and output are query-local.

To dry-run validate relation metadata, column types, and options without execution, see gpu_validate_call.