Skip to main content

Canonical Correlation Analysis Zoo: CCA, GCCA, MCCA, DCCA, DGCCA, DVCCA, DCCAE, KCCA and regularised variants including sparse CCA , ridge CCA and elastic CCA

Project description

DOI codecov Build Status Documentation Status

Documentation at

Can be installed using pip install cca-zoo

Recently added DCCA by non-linear orthogonal iterations (


If this repository was helpful to you please do give a star.

In case this work is used as part of research I attach a DOI bibtex entry:

  author       = {jameschapman19},  
  title        = {jameschapman19/cca\_zoo: First pre-release},  
  month        = dec,  
  year         = 2020,  
  publisher    = {Zenodo},  
  version      = {v1.1.6},  
  doi          = {10.5281/zenodo.4382740},  
  url          = {}  

Canonical Correlation Analysis Methods: cca-zoo

Linear CCA/PLS:

A variety of linear CCA and PLS methods implemented where possible as the solutions to generalized eigenvalue problems and otherwise using alternating minimization methods for non-convex optimisation based on least squares

CCA (Canonical Correlation Analysis)

Solutions based on either alternating least squares or as the solution to genrralized eigenvalue problem

GCCA (Generalized CCA) :

MCCA (Multiset CCA)

SCCA (Sparse CCA) :

Mai's sparse CCA

SPLS (Sparse PLS/Penalized Matrix Decomposition) :

Witten's sparse CCA

PCCA (Penalized CCA - elastic net)

Waiijenborg's elastic penalized CCA

Deep CCA:

A variety of Deep CCA and related methods. All allow for user to pass their own model architectures. Recently added solutions to DCCA using nob-linear orthogonal iterations (or alternating least squares)

DCCA (Deep CCA) : Using either Andrew's original Tracenorm Objective or Wang's alternating least squares solution

DGCCA (Deep Generalized CCA) : An alternative objective based on the linear GCCA solution. Can be extended to more than 2 views

DMCCA (Deep Multiset CCA) : An alternative objective based on the linear MCCA solution. Can be extended to more than 2 views

DCCAE (Deep Canonically Correlated Autoencoders) :

DVCCA/DVCCA Private (Deep variational CCA): Wang's DVCCA and DVCCA Private

Kernel CCA:

Linear Kernel

RBF Kernel

Polynomial Kernels


I've translated my work building baselines for my own research into a python package for my own experience but also, I hope, to help others. With that in mind if you have either suggestions for improvements/additions do let me know using the issues tab. The intention is to give flexibility to build new algorithms and substitute model architectures but there is a tradeoff between robustness and flexibility.


I've added this section to give due credit to the repositories that helped me in addition to their copyright notices in the code where relevant.

Models can be tested on data from MNIST datasets provided by the torch package ( and the UCI dataset provided by mvlearn package (

Other Implementations of DCCA/DCCAE:

Keras implementation of DCCA from @VahidooX's github page( The following are the other implementations of DCCA in MATLAB and C++. These codes are written by the authors of the original paper:

Torch implementation of DCCA from @MichaelVll & @Arminarj:

C++ implementation of DCCA from Galen Andrew's website (

MATLAB implementation of DCCA/DCCAE from Weiran Wang's website (

Implementation of VAE:

Torch implementation of VAE (

Implementation of Sparse PLS:

MATLAB implementation of SPLS by @jmmonteiro (

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cca-zoo, version 1.1.22
Filename, size File type Python version Upload date Hashes
Filename, size cca_zoo-1.1.22-py3-none-any.whl (43.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page