Multi-View Co-Regularized Spectral Clustering¶
- class polyview.cluster.mv_coreg_sc.MultiViewCoRegSpectralClustering(*args: Any, **kwargs: Any)¶
Bases:
BaseMultiViewClustererMulti-view co-regularized spectral clustering algorithm.
- Parameters:
n_clusters (int, default=2) – The number of clusters to form.
n_init (int, default=10) – Number of time the k-means algorithm will be run with different centroid seeds.
max_iter (int, default=50) – Maximum number of iterations of the alternating optimization.
v_lambda (float, default=0.01) – Weight of the agreement term between the embeddings of different views. Its suitable scale depends on
laplacian: values around 0.01 suit the normalized Laplacian, whose eigenvalues lie in [0, 2], whereas the unnormalized Laplacian scales with the node degrees.affinity (str, default='rbf') – Kernel to use for computing the affinity matrix. Should be a valid metric for sklearn.metrics.pairwise.pairwise_kernels.
eigen_solver ({'auto', 'dense', 'arpack'}, default='auto') – Solver for the
n_clusterssmallest eigenvectors computed at each iteration. The co-regularized Laplacians are applied matrix-free, without forming the (n, n) co-regularization terms. ‘dense’ materializes them and uses LAPACK restricted to the requested eigenpairs; ‘arpack’ uses an iterative Lanczos solver warm-started from the previous embedding. ‘auto’ picks ‘arpack’ whenn_samples > 200, ‘dense’ otherwise.random_state (int or None, default=None) – Determines random number generation for centroid initialization. Use an int to make the randomness deterministic.
tol (float, default=1e-6) – Stop when the change of the objective between two iterations is below
toltimes its initial value.laplacian ({"normalized", "unnormalized"}, default="normalized") – Graph Laplacian of each view: the symmetric normalized Laplacian I - D^{-1/2} A D^{-1/2} used by Kumar et al. (2011), or the unnormalized Laplacian D - A. The eigenvectors of the unnormalized Laplacian can concentrate on a few low-degree samples, which degrades the clustering on some datasets.
gamma (float, 'median' or None, default=None) – Kernel coefficient passed to the affinity.
Noneuses the sklearn default (1 / n_featuresfor ‘rbf’).'median'uses the median heuristic:gamma = 1 / (2 * median(||x_i - x_j||^2))for ‘rbf’ (1 / median(||x_i - x_j||_1)for ‘laplacian’).
- embedding_¶
The concatenated spectral embeddings from all views after fitting.
- Type:
np.ndarray of shape (n_samples, n_clusters * n_views)
- view_embeddings_¶
The orthonormal spectral embedding
U_vlearned for each view.- Type:
list of np.ndarray of shape (n_samples, n_clusters)
- objective_¶
The objective function values at each iteration of the optimization process.
- Type:
list of float
- n_iter_¶
Number of iterations run.
- Type:
int
Notes
Each view v has a spectral embedding U_v with orthonormal columns. Following the pairwise co-regularization of Kumar et al. (2011), the method minimizes
J = sum_v tr(U_v^T L_v U_v) - v_lambda * sum_{v<w} tr(U_v U_v^T U_w U_w^T),
i.e. the spectral clustering objective of each view minus the agreement between the embeddings of each pair of views, which is maximal when they span the same subspace. The views are updated one at a time: given the other embeddings, the optimal U_v is formed by the eigenvectors of L_v - v_lambda * sum_{w != v} U_w U_w^T with the smallest eigenvalues, so that J never increases. The final clusters are obtained by k-means on the row-normalized concatenation of the embeddings. By default, L_v = I - D_v^{-1/2} A_v D_v^{-1/2} is the symmetric normalized Laplacian of the affinity matrix A_v of view v, as in Kumar et al.; the unnormalized Laplacian D_v - A_v is available with
laplacian="unnormalized".References
Kumar, A. et al. (2011). Co-regularized Multi-view Spectral Clustering. Advances in Neural Information Processing Systems 24.
- fit(views: List[numpy.ndarray], y=None) None¶
Fits the multi-view co-regularized spectral clustering model to the provided views.
- Parameters:
views (list of np.ndarray) – List of data matrices for each view, where each matrix has shape (n_samples, n_features_v).