cca_zoo.tree¶
Gradient-boosted-tree nonlinear CCA methods. Requires pip install cca-zoo[tree].
XGBoostCCA ¶
XGBoostCCA(
n_components: int = 1,
*,
center: bool = True,
n_estimators: int | list[int] = 200,
max_depth: int | list[int] = 3,
learning_rate: float | list[float] = 0.1,
subsample: float | list[float] = 0.8,
colsample_bytree: float | list[float] = 0.8,
min_child_weight: float | list[float] = 20,
gauss_seidel: bool = True,
random_state: int | None = None,
)
Bases: TreeCCA
:class:TreeCCA with XGBoost boosters.
Parameters and attributes are those of :class:TreeCCA.
References
Chapman, J. (2026). TreeCCA: Canonical Correlation Analysis via Gradient-Boosted Trees. arXiv:2607.27027.
Examples:
>>> import numpy as np
>>> from cca_zoo.tree import XGBoostCCA
>>> rng = np.random.default_rng(0)
>>> X1 = rng.standard_normal((100, 5))
>>> X2 = rng.standard_normal((100, 5))
>>> model = XGBoostCCA(
... n_components=2, n_estimators=[10, 20], max_depth=[3, 6]
... ).fit([X1, X2])
>>> Z1, Z2 = model.transform([X1, X2])
Source code in cca_zoo/tree/_treecca.py
LightGBMCCA ¶
LightGBMCCA(
n_components: int = 1,
*,
center: bool = True,
n_estimators: int | list[int] = 200,
max_depth: int | list[int] = 3,
learning_rate: float | list[float] = 0.1,
subsample: float | list[float] = 0.8,
colsample_bytree: float | list[float] = 0.8,
min_child_weight: float | list[float] = 20,
gauss_seidel: bool = True,
random_state: int | None = None,
)
Bases: TreeCCA
:class:TreeCCA with LightGBM boosters.
Parameters and attributes are those of :class:TreeCCA. Requires
lightgbm, in the tree extra.
References
Chapman, J. (2026). TreeCCA: Canonical Correlation Analysis via Gradient-Boosted Trees. arXiv:2607.27027.
Examples:
>>> import numpy as np
>>> from cca_zoo.tree import LightGBMCCA
>>> rng = np.random.default_rng(0)
>>> X1 = rng.standard_normal((100, 5))
>>> X2 = rng.standard_normal((100, 5))
>>> model = LightGBMCCA(n_components=2, n_estimators=10).fit([X1, X2])
Source code in cca_zoo/tree/_treecca.py
CatBoostCCA ¶
CatBoostCCA(
n_components: int = 1,
*,
center: bool = True,
n_estimators: int | list[int] = 200,
max_depth: int | list[int] = 3,
learning_rate: float | list[float] = 0.1,
subsample: float | list[float] = 0.8,
colsample_bytree: float | list[float] = 0.8,
min_child_weight: float | list[float] = 20,
gauss_seidel: bool = True,
random_state: int | None = None,
)
Bases: TreeCCA
:class:TreeCCA with CatBoost boosters.
Parameters and attributes are those of :class:TreeCCA. Requires
catboost, in the tree extra. Slower per round than the other
backends, since CatBoost rebuilds each booster to add a tree.
References
Chapman, J. (2026). TreeCCA: Canonical Correlation Analysis via Gradient-Boosted Trees. arXiv:2607.27027.
Examples:
>>> import numpy as np
>>> from cca_zoo.tree import CatBoostCCA
>>> rng = np.random.default_rng(0)
>>> X1 = rng.standard_normal((100, 5))
>>> X2 = rng.standard_normal((100, 5))
>>> model = CatBoostCCA(n_components=2, n_estimators=10).fit([X1, X2])