Skip to main content
CCA-Zoo

CCA-Zoo

Multiview Canonical Correlation Analysis in Python

PyPI Python CI codecov DOI License: MIT uv Ruff Types: mypy strict

CCA-Zoo is a Python library of reference implementations of Canonical Correlation Analysis (CCA) algorithms from the literature, from classical CCA (Hotelling 1936) through sparse, kernel, deep, and probabilistic variants — each documented with the paper it comes from. It's also built to be used directly: every model follows the same scikit-learn estimator API (fit, transform, fit_transform, score), is fully typed (PEP 561), and is tested against known closed-form solutions where one exists.


Installation

uv add cca-zoo        # or: pip install cca-zoo

Install optional extras as needed:

uv add "cca-zoo[deep]"          # DCCA variants (requires PyTorch + Lightning)
uv add "cca-zoo[probabilistic]" # Probabilistic CCA (requires NumPyro + JAX)
uv add "cca-zoo[tree]"          # XGBoostCCA, LightGBMCCA, CatBoostCCA
uv add "cca-zoo[all]"           # Everything above

(substitute pip install for uv add if you're not using uv)


Quick start

from cca_zoo.datasets import JointData
from cca_zoo.linear import CCA

# Generate correlated two-view data from a linear latent variable model
data = JointData(
    n_views=2,
    n_samples=200,
    n_features=[50, 50],
    latent_dimensions=2,
    signal_to_noise=2.0,
    random_state=0,
)
train_views = data.sample()
test_views = data.sample()

# Fit CCA and evaluate
model = CCA(latent_dimensions=2).fit(train_views)
print(model.score(test_views))  # canonical correlations, shape (2,)

# Project views into the shared latent space
z1, z2 = model.transform(test_views)  # each shape (200, 2)

Available methods

cca_zoo.linear

Class Description Citation Views
CCA Standard CCA Hotelling (1936) 2
rCCA Regularised CCA / canonical ridge Vinod (1976) 2
PLS Partial Least Squares Wold (1975) 2
MCCA Multiset CCA — pairwise sum objective Kettenring (1971) ≥2
GCCA Generalised CCA — shared latent projection Tenenhaus & Tenenhaus (2011) ≥2
TCCA Tensor CCA — higher-order cross-moment Kim, Wong & Cipolla (2007) ≥2
PartialCCA CCA adjusted for confounding variables Rao (1969) ≥2
GRCCA Group-regularised CCA Tuzhilina, Tozzi & Hastie (2021) ≥2
CCAR3 CCA via reduced-rank regression, row-sparse in high dimensions Donnat & Tuzhilina (2024) 2
ECCA CCA via reduced-rank regression, entrywise-sparse (ccar3 package's ecca) Donnat & Tuzhilina (2024) 2
GraphicalLassoCCA MCCA with an L1-penalised sparse-precision within-view covariance Friedman, Hastie & Tibshirani (2008) ≥2
CCAEY Eckart-Young CCA, full-batch L-BFGS-B (2 or more views) Chapman, Wells & Lawry Aguila (2024) ≥2
PLSEY Eckart-Young PLS, full-batch L-BFGS-B Chapman, Wells & Lawry Aguila (2024) ≥2
HuberCCA Bounded-influence (Huber-style) EY-CCA, robust to high-leverage outliers — ≥2
RANSACCCA Robust CCA via random sample consensus, robust to mismatched/corrupted rows — ≥2
TrimmedCCA Robust CCA via LTS/MCD-style concentration steps, holds up near ~50% contamination Rousseeuw & Van Driessen (1999) ≥2

cca_zoo.nonparametric

Class Description Citation
KCCA Kernel CCA Hardoon, Szedmak & Shawe-Taylor (2004)
KGCCA Kernel Generalised CCA Tenenhaus, Philippe & Frouin (2015)
KTCCA Kernel Tensor CCA Kim, Wong & Cipolla (2007)
ManifoldCCA Transductive CCA over a shared graph Laplacian or LLE operator Belkin & Niyogi (2003); Roweis & Saul (2000)

cca_zoo.tree (requires [tree])

Class Description Citation Views
XGBoostCCA Gradient-boosted-tree CCA via XGBoost (Eckart-Young objective) Chapman (2026) ≥2
LightGBMCCA Gradient-boosted-tree CCA via LightGBM (Eckart-Young objective) Chapman (2026) ≥2
CatBoostCCA Gradient-boosted-tree CCA via CatBoost (Eckart-Young objective) Chapman (2026) ≥2

cca_zoo.gam

Class Description Citation Views
GAMCCA Generalized-additive-model CCA (Eckart-Young objective) Chapman, Wells & Lawry Aguila (2024) ≥2

cca_zoo.gp

Class Description Citation Views
GPCCA Gaussian-process CCA (Eckart-Young objective), with predictive uncertainty Chapman, Wells & Lawry Aguila (2024) ≥2

cca_zoo.sparse

Class Description Citation Views
ElasticNetCCA Sparse linear CCA via coordinate descent (Eckart-Young objective) — ≥2
MultiTaskElasticNetCCA ElasticNetCCA with row-group sparsity shared across latent dimensions — ≥2
OrthogonalMatchingPursuitCCA Fixed-cardinality sparse linear CCA via greedy selection (Eckart-Young objective) — ≥2
PMDCCA Sparse CCA via PMD Witten, Tibshirani & Hastie (2009) ≥2
ADMMCCA Sparse CCA via ADMM Suo, Mineiro & Anandkumar (2017) ≥2
IPLSCCA Sparse CCA via iterative PLS Mai & Zhang (2019) ≥2
SpanCCA Hard-threshold ALS inspired by the SpanCCA algorithm Asteris, Kyrillidis, Koyejo & Poldrack (2016) ≥2
WaijenborgCCA Elastic net regularised CCA Waaijenborg, de Witt Hamer & Zwinderman (2008) ≥2
ParkhomenkoCCA Soft-threshold sparse CCA Parkhomenko, Tritchler & Beyene (2009) ≥2
SAR Sparse alternating regression, BIC-selected penalty Wilms & Croux (2015) ≥2

cca_zoo.stochastic

Class Description Citation Views
StochasticCCAEY CCAEY, fit by mini-batch momentum SGD Chapman, Wells & Lawry Aguila (2024) ≥2

cca_zoo.deep (requires [deep])

Built on PyTorch Lightning — models are trained with a standard lightning.Trainer, not a fit() wrapper. See the deep learning guide.

Class Description Citation
DCCA Deep CCA, pluggable objective Andrew et al. (2013)
DCCA_EY Deep CCA via Eigengame / Eckart-Young objective Chapman, Wells & Lawry Aguila (2024)
DCCA_NOI Deep CCA via non-linear orthogonal iterations Wang et al. (2015)
DCCA_SDL Deep CCA via stochastic decorrelation loss Chang, Xiang & Hospedales (2018)
DCCAE Deep CCA with autoencoder reconstruction Wang et al. (2015)
DVCCA Deep variational CCA Wang et al. (2016)
DTCCA Deep tensor CCA Wong et al. (2021)
DMCCA Deep multiset CCA — pairwise-sum objective, ≥2 views Kettenring (1971)
DGCCA Deep generalised CCA, ≥2 views Benton et al. (2019)
SplitAE Split autoencoder baseline —
BarlowTwins Self-supervised learning via redundancy reduction Zbontar et al. (2021)
VICReg Variance-Invariance-Covariance Regularization Bardes, Ponce & LeCun (2022)

cca_zoo.probabilistic

Class Description Citation
GFA Group Factor Analysis, per-view ARD; no extra dependencies Klami, Virtanen & Kaski (2013)
ProbabilisticCCA (requires [probabilistic]) MCMC via NumPyro Bach & Jordan (2005)
VariationalBayesCCA (requires [probabilistic]) Variational inference + ARD via NumPyro Wang (2007)

cca_zoo.model_selection

Class Description Citation
GridSearchCV Cross-validated hyperparameter search for multiview models —

Documentation

Full documentation, user guides, and API reference at: https://jameschapman19.github.io/cca_zoo/

See CHANGELOG.md for what's changed between releases.


Citing

If CCA-Zoo is useful in your research, please cite:

@article{Chapman2021,
  title   = {{CCA-Zoo}: A collection of Regularized, Deep Learning based, Kernel,
             and Probabilistic {CCA} methods in a scikit-learn style framework},
  author  = {Chapman, James and Wang, Hao-Ting and Wells, Lennie and Wiesner, Johannes},
  journal = {Journal of Open Source Software},
  volume  = {6},
  number  = {68},
  pages   = {3823},
  year    = {2021},
  doi     = {10.21105/joss.03823},
}

Contributing

Contributions are welcome. See docs/contributing.md for development setup, coding standards, and pull request guidelines. Please also read our Code of Conduct.

Found a security issue? See SECURITY.md for how to report it privately.

Metadata

Release files for cca-zoo 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cca-zoo 3.3.0
File Size Uploaded
cca_zoo-3.3.0.tar.gz 573.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cca-zoo 3.3.0
File Interpreter ABI Platform
cca_zoo-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 788.1 kB

Release files / cca_zoo-3.3.0.tar.gz

Download URL cca_zoo-3.3.0.tar.gz
Size 573.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0309e25a55aca0b7f1c262039149529de93e05b778dbc8cba6a5b2c058d6628a
BLAKE2b-256 checksum
How to use checksums
107210aa9e28749b319a4cb285b987c4f4601d3a820d613b15844b5ae6e3d607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / cca_zoo-3.3.0-py3-none-any.whl

Download URL cca_zoo-3.3.0-py3-none-any.whl
Size 214.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ec1bd3f21d542bf49038beb6f41220fda8e5f99c9361a7ad9383129f8f893f3
BLAKE2b-256 checksum
How to use checksums
d95f847f9048ec2545bb5460cf683996002f2a6ed3fb2acd88bc7f2138a67fd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

4.0

2 release files

This release

3.3.0 This release

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.11

2 release files

2.3.10

2 release files

2.3.9

2 release files

2.3.8

2 release files

2.3.7

2 release files

2.3.6

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.17.3

2 release files

1.17.2

2 release files

1.17.1

2 release files

1.17.0

2 release files

1.16.9

2 release files

1.16.8

2 release files

1.16.7

2 release files

1.16.2

2 release files

1.16.1

2 release files

1.16.0

2 release files

1.15.1

2 release files

1.15.0

2 release files

1.14.0

2 release files

1.13.5

2 release files

1.13.2

2 release files

1.12.9

2 release files

1.12.8

2 release files

1.12.3

2 release files

1.12.2

2 release files

1.12.1

2 release files

1.12.0

2 release files

1.11.1

2 release files

1.11.0

2 release files

1.10.8

2 release files

1.10.7

2 release files

1.10.2

2 release files

1.10.1

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.13

2 release files

1.7.12

2 release files

1.7.11

2 release files

1.7.10

2 release files

1.7.9

2 release files

1.7.8

2 release files

1.7.7

2 release files

1.7.6

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.28

1 release file

1.1.27

1 release file

1.1.26

1 release file

1.1.25

1 release file

1.1.24

1 release file

1.1.23

1 release file

1.1.22

1 release file

1.1.21

1 release file

1.1.20

1 release file

1.1.19

1 release file

1.1.18

1 release file

1.1.17

1 release file

1.1.16

1 release file

1.1.15

1 release file

1.1.14

1 release file

1.1.13

1 release file

1.1.12

1 release file

1.1.11

1 release file

1.1.10

1 release file

1.1.9

1 release file

1.1.8

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page