Skip to main content

UMAP

SQL function: cuml_umap

Official cuML reference: Python API

cuML UMAP fits a deterministic, query-local manifold embedding for Float32 rows.

Quickstart

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

SELECT id, dim_0, dim_1 FROM cuml_umap(input => (SELECT id, d0, d1 FROM t), n_neighbors => 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
n_componentsintegernoNumber of embedding dimensions.
n_neighborsintegernoNumber of neighbors used to construct the manifold.
n_epochsintegernoOptimization epochs; zero selects the native default.
learning_ratenumbernoPositive embedding optimization rate.
min_distnumbernoMinimum distance between embedded points; at most spread.
spreadnumbernoPositive scale for embedded point distances.
set_op_mix_rationumbernoFuzzy-set intersection/union mix in [0, 1].
local_connectivitynumbernoLocal connectivity adjustment.
repulsion_strengthnumbernoRepulsive force applied during optimization.
negative_sample_rateintegernoNegative samples per positive edge.
initenum ("spectral", "random")noEmbedding initialization method.
random_stateintegernoSeed for reproducible initialization.

SQL value argument schemas

ArgumentRequiredLiteral shapeDefaultConstraintsDescription
initnostring"spectral"one of "spectral", "random"Embedding initialization method.
learning_ratenonumber1greater than 0Positive embedding optimization rate.
local_connectivitynonumber1minimum 0Local connectivity adjustment.
min_distnonumber0.1minimum 0Minimum distance between embedded points; at most spread.
n_componentsnointeger2minimum 1; maximum 2147483647Number of embedding dimensions.
n_epochsnointeger0minimum 0; maximum 2147483647Optimization epochs; zero selects the native default.
n_neighborsnointeger15minimum 1; maximum 2147483647Number of neighbors used to construct the manifold.
negative_sample_ratenointeger5minimum 1; maximum 2147483647Negative samples per positive edge.
random_statenointeger0minimum 0; maximum 18446744073709551615Seed for reproducible initialization.
repulsion_strengthnonumber1minimum 0Repulsive force applied during optimization.
set_op_mix_rationonumber1minimum 0; maximum 1Fuzzy-set intersection/union mix in [0, 1].
spreadnonumber1greater than 0Positive scale for embedded point distances.

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.
dim_<index>Float32noEmbedded dimension value, repeated n_components times. The output contains n_components such columns, dim_0 through dim_&lt;n_components - 1&gt;.

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, brute-force kNN, and deterministic mode are fixed.
  • Empty input returns an empty result. Other inputs require n_neighbors < rows, checked at execution.
  • min_dist must not exceed spread. The fit and embedding are query-local.

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