Rademacher random projection
The components of the random matrix are drawn from:
- -sqrt(s) / sqrt(n_components) with probability 1 / 2
- +sqrt(s) / sqrt(n_components) with probability 1 / 2
| Parameters: | n_components : int or ‘auto’, optional (default = ‘auto’)
eps : strictly positive float, optional (default=0.1)
random_state : integer, RandomState instance or None (default=None)
|
|---|
Attributes
| n_component_ | int | Concrete number of components computed when n_components=”auto”. |
| components_ | numpy array of shape [n_components, n_features] | Random matrix used for the projection. |
Methods
| fit(X[, y]) | Generate a sparse random projection matrix |
| 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[, y]) | Project the data by using matrix product with the random matrix |
Generate a sparse random projection matrix
| Parameters: | X : numpy array or scipy.sparse of shape [n_samples, n_features]
y : is not used: placeholder to allow for usage in a Pipeline. |
|---|---|
| Returns: | self : |
Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
| Parameters: | X : numpy array of shape [n_samples, n_features]
y : numpy array of shape [n_samples]
|
|---|---|
| Returns: | X_new : numpy array of shape [n_samples, n_features_new]
|
Get parameters for this estimator.
| Parameters: | deep: boolean, optional :
|
|---|---|
| Returns: | params : mapping of string to any
|
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The former have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.
| Returns: | self : |
|---|
Project the data by using matrix product with the random matrix
| Parameters: | X : numpy array or scipy.sparse of shape [n_samples, n_features]
y : is not used: placeholder to allow for usage in a Pipeline. |
|---|---|
| Returns: | X_new : numpy array or scipy sparse of shape [n_samples, n_components]
|