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)¶ 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_ddof
- cov_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.nan
ifcov_out_of_bounds=='nan'
, or ignore the problem ifcov_out_of_bounds == 'ignore'
- normalize_weights (bool (default True)) – If
normalize_weights == False
weights are calculated as in Härdle and Simar (2015). In this case they are not normalized (i.e. || w ||_2 != 1). Setnormalize_weights
to 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 in
SVDPLS
,SVDCCA
,NIPALSPLS
andNIPALSCCA
for the association strength that is optimized by each particular methodType: 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)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
([n_components, covariance, scale, …])Initialize self. fit
(X, Y[, copy])Fit the estimator. fit_transform
(X, Y, **fit_params)Fit the estimator and return the resulting scores get_params
([deep])Get parameters for this estimator. score
(X, Y[, ftr])Returns the pearson correlation of the ftr-th canonical variates (scores). set_params
(**params)Set the parameters of this estimator. transform
(X, Y[, copy])Apply the previously fitted estimator to new data.