Skip to main content

Module cca

Module cca 

Source
Expand description

Canonical Correlation Analysis.

Mirrors sklearn.cross_decomposition.CCA (and PLSCanonical for the univariate case). Given paired (X, Y), CCA finds linear combinations Xa and Yb that are maximally correlated.

Closed form via SVD:

  1. Centre and whiten both X and Y (X_white = X · K_x, Y_white = Y · K_y).
  2. Compute the cross-covariance C = X_whiteᵀ · Y_white / (n - 1).
  3. SVD C = U Σ Vᵀ. The first k columns of K_x · U and K_y · V are the loadings x_weights_ and y_weights_ (sklearn’s naming).
  4. Σ_ii are the canonical correlations.

Structs§

Cca
FittedCca