Multi-View Co-Training Spectral Clustering

class polyview.cluster.mv_cotrain_sc.MultiViewCoTrainSpectralClustering(*args: Any, **kwargs: Any)

Bases: BaseMultiViewClusterer

Multi-view co-training spectral clustering algorithm (Kumar & Daumé, 2011).

Each view starts from its own spectral embedding U_v: the n_clusters leading eigenvectors of the normalised similarity D_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_v is 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. 0 gives 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. None uses the sklearn default (1 / n_features for ‘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_clusters over all pairs of views, which lies in [0, 1] (1 means all views span the same eigenspace). It has max_iter entries.

Type:

list of float

labels_

Cluster labels for each sample after fitting.

Type:

np.ndarray of shape (n_samples,)

Notes

S_v has rank at most 2 (n_views - 1) n_clusters, so its leading eigenvectors are computed exactly in that low-dimensional subspace, without any n_samples x n_samples eigendecomposition 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

fit_predict(views: List[numpy.ndarray], y=None) → numpy.ndarray

Fit and return cluster labels.

Parameters:
  • views (list of array-like)

  • y (ignored)

Returns:

labels

Return type:

ndarray of shape (n_samples,)