sliced.save.
SlicedAverageVarianceEstimation
(n_directions='auto', n_slices=10, copy=True)[source]¶Sliced Average Variance Estimation (SAVE) [1]
Linear dimensionality reduction using the conditional covariance, Cov(X|y), to identify the directions defining the central subspace of the data.
The algorithm performs a weighted principal component analysis on a transformation of slices of the covariance matrix of the whitened data, which has been sorted with respect to the target, y.
Since SAVE looks at second moment information, it may miss first-moment
information. In particular, it may miss linear trends. See
sliced.sir.SlicedInverseRegression
, which is able to detect
linear trends but may fail in other situations. If possible, both SIR and
SAVE should be used when analyzing a dataset.
Parameters: |
|
---|
References
Examples
>>> import numpy as np
>>> from sliced import SlicedAverageVarianceEstimation
>>> from sliced.datasets import make_quadratic
>>> X, y = make_quadratic(random_state=123)
>>> save = SlicedAverageVarianceEstimation(n_directions=2)
>>> save.fit(X, y)
SlicedAverageVarianceEstimation(copy=True, n_directions=2, n_slices=10)
>>> X_save = save.transform(X)
Attributes: |
|
---|
Methods
fit (X, y) |
Fit the model with X and y. |
fit_transform (X[, y]) |
Fit to data, then transform it. |
get_params ([deep]) |
Get parameters for this estimator. |
set_params (**params) |
Set the parameters of this estimator. |
transform (X) |
Apply dimension reduction on X. |
__init__
(n_directions='auto', n_slices=10, copy=True)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
__init__ ([n_directions, n_slices, copy]) |
Initialize self. |
fit (X, y) |
Fit the model with X and y. |
fit_transform (X[, y]) |
Fit to data, then transform it. |
get_params ([deep]) |
Get parameters for this estimator. |
set_params (**params) |
Set the parameters of this estimator. |
transform (X) |
Apply dimension reduction on X. |