PCA
Python module: cuvs.preprocessing.pca
Params
Parameters for PCA decomposition.
Parameters
Constructor
Members
n_components
copy
whiten
algorithm
tol
n_iterations
fit
@auto_sync_resources
Compute PCA (fit only).
Computes the principal components, explained variances, singular values, and column means from the input data.
The input layout (C-contiguous / row-major or F-contiguous / col-major) is preserved natively; no internal copy/transpose is performed. Output arrays use the same layout as the input.
Parameters
Returns
FitOutput
Named tuple with fields: components, explained_var,
explained_var_ratio, singular_vals, mu,
noise_vars. components matches the layout of X.
Examples
fit_transform
@auto_sync_resources
Compute PCA and transform the input data in a single operation.
The input layout (C- or F-contiguous) is preserved natively; output arrays use the same layout.
Parameters
Returns
FitTransformOutput
Named tuple with fields: trans_input, components,
explained_var, explained_var_ratio, singular_vals,
mu, noise_vars. trans_input and components match
the layout of X.
Examples
inverse_transform
@auto_sync_resources
@auto_convert_output
Transform data from the PCA eigenspace back to the original space.
The layout (C- or F-contiguous) of trans_input is preserved;
components and output are aligned to that layout.
Parameters
Returns
Examples
transform
@auto_sync_resources
@auto_convert_output
Transform data into the PCA eigenspace.
Uses previously computed principal components from fit or
fit_transform. The input layout (C- or F-contiguous) of X
determines the layout used internally; components and
trans_input are aligned to that layout.
Parameters
Returns
Examples