class sklearn.random_projection.GaussianRandomProjection(n_components=’auto’, eps=0.1, random_state=None)
[source]
Reduce dimensionality through Gaussian random projection
The components of the random matrix are drawn from N(0, 1 / n_components).
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
See also
>>> import numpy as np >>> from sklearn.random_projection import GaussianRandomProjection >>> X = np.random.rand(100, 10000) >>> transformer = GaussianRandomProjection() >>> X_new = transformer.fit_transform(X) >>> X_new.shape (100, 3947)
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) | Project the data by using matrix product with the random matrix |
__init__(n_components=’auto’, eps=0.1, random_state=None)
[source]
fit(X, y=None)
[source]
Generate a sparse random projection matrix
Parameters: |
|
---|---|
Returns: |
|
fit_transform(X, y=None, **fit_params)
[source]
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: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: |
|
---|
transform(X)
[source]
Project the data by using matrix product with the random matrix
Parameters: |
|
---|---|
Returns: |
|
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.random_projection.GaussianRandomProjection.html