Functions | |
| void | single_linkage (const raft::handle_t &handle, const float *X, int n_rows, int n_cols, size_t n_clusters, ML::distance::DistanceType metric, int *children, int *labels, bool use_knn=false, int c=15) |
| Computes single-linkage hierarchical clustering on a dense input feature matrix and outputs the labels, dendrogram, and minimum spanning tree. More... | |
| void ML::linkage::single_linkage | ( | const raft::handle_t & | handle, |
| const float * | X, | ||
| int | n_rows, | ||
| int | n_cols, | ||
| size_t | n_clusters, | ||
| ML::distance::DistanceType | metric, | ||
| int * | children, | ||
| int * | labels, | ||
| bool | use_knn = false, |
||
| int | c = 15 |
||
| ) |
Computes single-linkage hierarchical clustering on a dense input feature matrix and outputs the labels, dendrogram, and minimum spanning tree.
| [in] | handle | raft handle to encapsulate expensive resources |
| [in] | X | dense feature matrix on device, C contiguous |
| [in] | n_rows | number of rows in X |
| [in] | n_cols | number of columns in X |
| [in] | n_clusters | the number of clusters to fit. |
| [in] | metric | distance metric to use. Must be supported by the dense pairwise distances API. |
| [out] | children | the output dendrogram, shape=(n_rows - 1, 2), C contiguous |
| [out] | labels | the output labels, shape=(n_rows,) |
| [in] | use_knn | whether to construct a knn graph instead of the full n^2 pairwise distance matrix. This can be faster for very large datasets or in cases where lower memory usage is required. |
| [in] | c | tunes the number of neighbors when use_knn is true, where n_neighbors=log(n_rows) + c. |