pyccea.projection package
Submodules
pyccea.projection.cipls module
- class pyccea.projection.cipls.CIPLS(n_components=10, copy=True)[source]
Bases:
BaseEstimator
Covariance-free Partial Least Squares (CIPLS).
Jordao, Artur, et al. “Covariance-free partial least squares: An incremental dimensionality reduction method.” Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (2021). Source: https://github.com/arturjordao/IncrementalDimensionalityReduction
- Attributes:
- n: int
Number of iterations. It starts at 0 and incrementally goes up to the number of samples (n_samples).
- n_features: int
Number of variables.
- x_weights_: np.ndarray (n_features, n_components)
Projection matrix.
- x_scores_: np.ndarray (n_samples, n_components)
The transformed training samples (latent components).
- x_loadings_: np.ndarray (n_features, n_components)
The loadings of X.
- y_loadings_: np.ndarray (n_targets, n_components)
The loadings of Y, where n_targets is the number of response variables.
- x_rotations_: np.ndarray (n_components, n_features)
Transposed and non-normalized projection matrix.
- sum_x: np.ndarray (n_features,)
The sum of each feature individually across all training samples.
- sum_y: np.ndarray (1,)
The sum of targets across all training samples.
Methods
fit
(X, Y)Fit model to data
get_metadata_routing
()Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
normalize
(x)Scale input vectors individually to unit norm (vector length).
set_params
(**params)Set the parameters of this estimator.
transform
(X[, Y])Apply the dimension reduction learned on the training data.
pyccea.projection.vip module
- class pyccea.projection.vip.VIP(model)[source]
Bases:
object
Variable Importance in Projection (VIP).
Mehmood, Tahir, et al. “A review of variable selection methods in partial least squares regression.” Chemometrics and intelligent laboratory systems 118 (2012): 62-69. Source: https://github.com/scikit-learn/scikit-learn/issues/7050
- Attributes:
- n_featuresint
Number of variables.
- n_componentsint
Number of components.
- x_rotations_np.ndarray (n_features, n_components)
Projection matrix used to transform X.
- x_scores_np.ndarray (n_samples, n_components)
The transformed training samples (latent components).
- y_loadings_np.ndarray (n_targets, n_components)
The loadings of Y.
- importancesnp.ndarray (n_features,)
Importance of each feature based on its contribution to yield the latent space.
Methods
compute
()Calculate feature importances.