gemmr.estimators.SVDPLS

class gemmr.estimators.SVDPLS(n_components=1, covariance='empirical', scale=True, std_ddof=0, calc_loadings=False)

Partial Least Squares estimators 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)
covs_

contains the covariances between scores. This is the quantity that is maximized by PLS

Type:np.ndarray (n_components,)
assocs_

Identical to covs_. assocs_` is the common identifier used in in SVDPLS, SVDCCA, NIPALSPLS and NIPALSCCA for the association strength that is optimized by each particular method

Type:np.ndarray (n_components,)
__init__(n_components=1, covariance='empirical', scale=True, std_ddof=0, calc_loadings=False)

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.
set_params(**params) Set the parameters of this estimator.
transform(X, Y[, copy]) Apply the previously fitted estimator to new data.
fit(X, Y, copy=True)

Fit the estimator.

Parameters:
  • X (np.ndarray (n_samples, n_X_features)) – data matrix X
  • Y (np.ndarray (n_samples, n_Y_features)) – data matrix Y
  • copy (bool) – Whether to copy X and Y, or perform in-place normalization.
Returns:

self – fitted estimator

Return type:

instance of this estimator

fit_transform(X, Y, **fit_params)

Fit the estimator and return the resulting scores

Parameters:
  • X (np.ndarray (n_samples, n_X_features)) – data matrix X
  • Y (np.ndarray (n_samples, n_Y_features)) – data matrix Y
  • fit_params (dict) – ignored
Returns:

  • x_scores (np.ndarray (n_samples, n_modes)) – learned scores for X
  • y_scores (np.ndarray (n_samples, n_modes)) – learned scores for Y

transform(X, Y, copy=True)

Apply the previously fitted estimator to new data.

Parameters:
  • X (np.ndarray (n_samples, n_X_features)) – data matrix X
  • Y (np.ndarray (n_samples, n_Y_features)) – data matrix Y
  • copy (boolean, default True) – Whether to copy X and Y, or perform in-place normalization.
Returns:

Return type:

x_scores if Y is not given, (x_scores, y_scores) otherwise.