Skip to main content

Multiset Canonical Correlation Analysis (mCCA) implementation

Project description

Multiset Canonical Correlation Analysis

Python implementation of multiset Canonical Correlation Analysis (mCCA) methods: sumcor, maxvar, minvar, ssqcor, genvar.

Installing multiset_canonical_correlation_analysis

The only pre-requisite is to have Python 3 (>= version 3.11) installed. The mCCA package can be installed with

pip install multiset_canonical_correlation_analysis

Required third party packages will automatically be installed.

Quickstart

First, the imports:

import numpy as np
from multiset_canonical_correlation_analysis import mCCA, simulations
from independent_vector_analysis.helpers_iva import _bss_isi

Create $K=100$ datasets with $T=10000$ samples of $N=5$ source components in each dataset. The $N$ SCVs all have a different maximum eigenvalue.

N = 5
K = 100
T = 10000
alpha = 1 - (K - np.array([10, 15, 20, 25, 30])) / (K - 1)
scv_cov = simulations.scv_covs_with_rank_R(N, K, 1, alpha=alpha, beta=0.0)
X, A, S = simulations.generate_datasets_from_covariance_matrices(scv_cov, T)

where

  • S : true sources of dimensions N x T x K
  • A : mixing matrix of dimensions N x N x K
  • X : observed datasets of dimensions N x T x K

Apply mCCA-genvar to find the canonical variables.

T, U = mcca.mcca(X, 'genvar')

where

  • T : transformation matrix of dimensions N x N x K
  • U : canonical variables of dimensions N x T x K, with U[:,:,k] = T[:,:,k].T @ X[:,:,k]

Calculate the jISI to evaluate JBSS performance.

W = np.moveaxis(T, [0, 1, 2], [1, 0, 2])
print(f'joint_isi genvar: {_bss_isi(W, A)[1]}')

A jISI smaller than 0.05 means successful JBSS, i.e., the canonical variables are permuted and scaled versions of the true sources.

Contact

In case of questions, suggestions, problems etc., please send an email to isabell.lehmann@sst.upb.de, or open an issue here on Github.

Citing

If you use this package in an academic paper, please cite [1].

@article{Lehmann2025,
  title={A Comprehensive Guide to Multiset Canonical Correlation Analysis and its Application to Joint Blind Source Separation},
  author={Lehmann, Isabell and Gabrielson, Ben and Hasija, Tanuj and Adali, T{\"u}lay},
  journal={tba},
  year={tba},
  publisher={tba}
}

[1] I. Lehmann, B. Gabrielson, et al., A Comprehensive Guide to Multiset Canonical Correlation Analysis and its Application to Joint Blind Source Separation, submitted in 2025

Project details


Download files

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

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file multiset_canonical_correlation_analysis-0.0.1.tar.gz.

File metadata

File hashes

Hashes for multiset_canonical_correlation_analysis-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4c2b39be2b3d96513906be6dbaca542710b3636168a54f0be70e0ed5967cad37
MD5 81e16b65e289888f89b7ed049351dbd9
BLAKE2b-256 7c82416aba2d0bffe81a49d6fc5626b4f7fa7a7c35125d4f83aeadd7b814d729

See more details on using hashes here.

File details

Details for the file multiset_canonical_correlation_analysis-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multiset_canonical_correlation_analysis-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c4118e44f653b63ce25c05031a208b7154c7239e4fcf42f709bbab3aa5b6cd
MD5 15eb280dbadcdfe06c77ed774843a4f2
BLAKE2b-256 804b0023bc873d7fafd47d144bbc35640f4c5d72c040a49f95a2f59421d1ec5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page