Functions
ML::Spectral Namespace Reference

Functions

void fit_embedding (const raft::handle_t &handle, int *rows, int *cols, float *vals, int nnz, int n, int n_components, float *out, unsigned long long seed=1234567)
 

Function Documentation

◆ fit_embedding()

void ML::Spectral::fit_embedding ( const raft::handle_t &  handle,
int *  rows,
int *  cols,
float *  vals,
int  nnz,
int  n,
int  n_components,
float *  out,
unsigned long long  seed = 1234567 
)

Given a COO formatted (symmetric) knn graph, this function computes the spectral embeddings (lowest n_components eigenvectors), using Lanczos min cut algorithm.

Parameters
handlecuml handle
rowssource vertices of knn graph (size nnz)
colsdestination vertices of knn graph (size nnz)
valsedge weights connecting vertices of knn graph (size nnz)
nnzsize of rows/cols/vals
nnumber of samples in X
n_componentsthe number of components to project the X into
outoutput array for embedding (size n*n_comonents)
seedrandom seed to use in both the lanczos solver and k-means