Skip to main content

TSVD

SQL function: cuml_tsvd

Official cuML reference: Python API

cuML truncated SVD fits and transforms Float32 input rows.

Quickstart

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

SELECT id, pc_0, pc_1 FROM cuml_tsvd(input => (SELECT id, d0, d1 FROM t), n_components => 2) 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_componentsintegeryesNumber of transformed pc_<index> columns.
solverenum ("cov_eig_dq", "cov_eig_jacobi")noCovariance eigensolver used by the query-local fit.
tolnumbernoFinite nonnegative eigensolver tolerance.
n_iterationsintegernoMaximum number of eigensolver iterations.

SQL value argument schemas

ArgumentRequiredLiteral shapeDefaultConstraintsDescription
n_componentsyesintegerNo defaultminimum 1; maximum 2147483647Number of transformed pc_<index> columns.
n_iterationsnointeger15minimum 1; maximum 4294967295Maximum number of eigensolver iterations.
solvernostring"cov_eig_dq"one of "cov_eig_dq", "cov_eig_jacobi"Covariance eigensolver used by the query-local fit.
tolnonumber0minimum 0Finite nonnegative eigensolver tolerance.

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.
pc_<index>Float32noTransformed component value, repeated n_components times. The output contains n_components such columns, pc_0 through pc_&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.
  • Empty input returns an empty result without a native call. Nonempty input requires at least two evaluated rows and two feature dimensions. n_components cannot exceed dimension; known dimensions are checked during planning, otherwise execution reports a structured error.
  • Only Float32 features are supported. Use CAST in the input subquery for other element types.
  • Component sign is not semantic; this operation returns transformed rows only, not components, explained variance, or mean.
  • TSVD allocates a temporary rows * n_components score matrix inside the query device cap.

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