Sparse Subspace Clustering

SSC-OMP

build_representation_omp(X, K)

Builds K-sparse self-expressive representations of vectors in X in terms of other vectors in X

build_representation_omp_jit(X, K)

Builds K-sparse self-expressive representations of vectors in X in terms of other vectors in X

batch_build_representation_omp(X, K, batch_size)

Builds K-sparse self-expressive representations of vectors in X in terms of other vectors in X

batch_build_representation_omp_jit(X, K, …)

Builds K-sparse self-expressive representations of vectors in X in terms of other vectors in X

Utility functions

sparse_to_full_rep(X, I)

Combines values and indices arrays to sparse representations

sparse_to_bcoo(X, I)

“Combines values and indices arrays to a BCOO formatted sparse matrix

bcoo_to_sparse(C, k)

Converts it back to values and indices (column-wise) format

bcoo_to_sparse_jit(C, k)

Converts it back to values and indices (column-wise) format

rep_to_affinity(Z)

Converts sparse representations to symmetric affinity matrix

Metrics for quality of sparse subspace clustering

subspace_preservation_stats(C, labels)

Returns the statistics for subspace preservation

subspace_preservation_stats_jit(C, labels)

Returns the statistics for subspace preservation

sparse_subspace_preservation_stats(Z, I, labels)

Returns the statistics for subspace preservation from sparse representations

sparse_subspace_preservation_stats_jit(Z, I, …)

Returns the statistics for subspace preservation from sparse representations

Tools for analyzing data (with ground truth)

angles_between_points(X)

Returns an SxS matrix of angles between each pair of points

min_angles_inside_cluster(angles, cluster_sizes)

Returns the minimum angles for for each point with its neighbors inside the cluster

min_angles_outside_cluster(angles, cluster_sizes)

Returns the minimum angles for each point with its neighbors from all other clusters

nearest_neighbors_inside_cluster(angles, …)

Returns the index of the nearest neighbor for each point inside the cluster

nearest_neighbors_outside_cluster(angles, …)

Returns index of the nearest neighbor for each point with its neighbors from all other clusters

sorted_neighbors(angles)

Returns the neighbor indices sorted by angle between points

inn_positions(labels, sorted_neighbor_labels)

Returns the position of a neighbor inside the cluster for each point in its list of sorted neighbors across all clusters

Examples