gemmr.estimators.SVDCCA
- class gemmr.estimators.SVDCCA(n_components=1, covariance='empirical', scale=False, std_ddof=1, cov_out_of_bounds='nan', normalize_weights=True, calc_loadings=False)
Canonical Correlation Analysis estimator based on singular value decomposition.
- Parameters:
n_components (int >= 1) – number of between-set components to estimate
covariance (str) – must be ‘empirical’
scale (bool) – whether to divide each feature by its standard deviation before fitting
std_ddof (int >= 0) – when calculating standard deviations and covariances, they are normalized by
1 / n-std_ddofcov_out_of_bounds (str) – if fitting results in a canonical correlation > 1, which indicates some problem, potentially that too few samples were used raise an error if
cov_out_of_bounds=='raise', set association strengths and weight vectors tonp.nanifcov_out_of_bounds=='nan', or ignore the problem ifcov_out_of_bounds == 'ignore'normalize_weights (bool (default True)) – If
normalize_weights == Falseweights are calculated as in Härdle and Simar (2015). In this case they are not normalized (i.e. || w ||_2 != 1). Setnormalize_weightsto True to get normalized weights.
- corrs_
contains the canonical correlations. This is the quantity that’s maximized by CCA
- Type:
np.ndarray (n_components,)
- assocs_
Identical to corrs_.
assocs_is the common identifier used in inSVDPLS,SVDCCA,NIPALSPLSandNIPALSCCAfor the association strength that is optimized by each particular method- Type:
np.ndarray (n_components,)
References
Härdle and Simar, Applied Multivariate Statistical Analysis, Chapter 16, Springer (2015)
- __init__(n_components=1, covariance='empirical', scale=False, std_ddof=1, cov_out_of_bounds='nan', normalize_weights=True, calc_loadings=False)
Methods
__init__([n_components, covariance, scale, ...])fit(X, Y[, copy, x_align_ref])Fit the estimator.
fit_transform(X, Y, **fit_params)Fit the estimator and return the resulting scores
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
get_x_loadings(X)get_y_loadings(Y)score(X, Y[, ftr])Returns the pearson correlation of the ftr-th canonical variates (scores).
set_fit_request(*[, copy, x_align_ref])Request metadata passed to the
fitmethod.set_params(**params)Set the parameters of this estimator.
set_score_request(*[, ftr])Request metadata passed to the
scoremethod.set_transform_request(*[, copy])Request metadata passed to the
transformmethod.transform(X[, Y, copy])Apply the previously fitted estimator to new data.