sliced.sir.
SlicedInverseRegression
(n_directions='auto', n_slices=10, alpha=None, copy=True)[source]¶Sliced Inverse Regression (SIR) [1]
Linear dimensionality reduction using the inverse regression curve, E[X|y], to identify the directions defining the central subspace of the data.
The inverse comes from the fact that X and y are reversed with respect to the standard regression framework (estimating E[y|X]).
The algorithm performs a weighted principal component analysis on slices of the whitened data, which has been sorted with respect to the target, y.
For a binary target the directions found correspond to those found with Fisher’s Linear Discriminant Analysis (LDA).
Note that SIR may fail to estimate the directions if the conditional
density X|y is symmetric, so that E[X|y] = 0. See
sliced.save.SlicedAverageVarianceEstimation
,
which is able to overcome this limitation but may fail to pick up on
linear trends. If possible, both SIR and SAVE should be used when analyzing
a dataset.
Parameters: |
|
---|
References
Examples
>>> import numpy as np
>>> from sliced import SlicedInverseRegression
>>> from sliced.datasets import make_cubic
>>> X, y = make_cubic(random_state=123)
>>> sir = SlicedInverseRegression(n_directions=2)
>>> sir.fit(X, y)
SlicedInverseRegression(alpha=None, copy=True, n_directions=2, n_slices=10)
>>> X_sir = sir.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, alpha=None, copy=True)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
__init__ ([n_directions, n_slices, alpha, 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. |