Multi-View Co-Training Spectral Clustering¶
- class polyview.cluster.mv_cotrain_sc.MultiViewCoTrainSpectralClustering(*args: Any, **kwargs: Any)¶
Bases:
BaseMultiViewClustererMulti-view co-training spectral clustering algorithm (Kumar & Daumé, 2011).
Each view starts from its own spectral embedding
U_v: then_clustersleading eigenvectors of the normalised similarityD_v^{-1/2} K_v D_v^{-1/2}. At every iteration, the affinity of each view is projected onto the eigenspaces found in the other views, which keeps the within-cluster similarities the views agree on and removes the rest:S_v = sym((sum_{w != v} U_w U_w^T) K_v), sym(S) = (S + S^T) / 2 U_v <- leading eigenvectors of D_{S_v}^{-1/2} S_v D_{S_v}^{-1/2}
All views are updated from the previous iteration’s embeddings. The row-normalised concatenation of the final
U_vis clustered with k-means. The paper states the algorithm for two views; with more views, the projections onto the other views’ eigenspaces are summed.- 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) – Number of co-training iterations.
0gives the concatenation of the per-view spectral embeddings.affinity (str or callable, default='rbf') – Kernel to use for computing the affinity matrix. Should be a valid metric for sklearn.metrics.pairwise.pairwise_kernels, and must produce non-negative similarities.
lambda_reg (deprecated) – Has no effect. Kumar & Daumé’s co-training has no regularisation parameter; it is kept only so that existing code keeps running and will be removed in a future release.
random_state (int, RandomState instance or None, default=None) – Determines random number generation for the eigensolver start vector and the k-means centroid initialization. Use an int to make the randomness deterministic.
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_¶
Row-normalised concatenation of the co-trained spectral embeddings of all views, on which k-means is run.
- Type:
np.ndarray of shape (n_samples, n_clusters * n_views)
- objective_¶
Co-training does not optimise an explicit objective. This records, after each iteration, the mean cross-view agreement
tr(U_v U_v^T U_w U_w^T) / n_clustersover all pairs of views, which lies in[0, 1](1 means all views span the same eigenspace). It hasmax_iterentries.- Type:
list of float
Notes
S_vhas rank at most2 (n_views - 1) n_clusters, so its leading eigenvectors are computed exactly in that low-dimensional subspace, without anyn_samples x n_sampleseigendecomposition after the initialisation.References
Kumar, A., & Daumé, H. (2011). A co-training approach for multi-view spectral clustering. In Proceedings of the 28th International Conference on Machine Learning (ICML).
- fit(views: List[numpy.ndarray], y=None) MultiViewCoTrainSpectralClustering¶
Fit the co-training 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). At least two views are required.
y (ignored)
- Return type:
self