package sklearn
Module Random_projection.BaseRandomProjectionSource
Generate a sparse random projection matrix
Parameters ---------- X : numpy array or scipy.sparse of shape n_samples, n_features Training set: only the shape is used to find optimal random matrix dimensions based on the theory referenced in the afore mentioned papers.
y Ignored
Returns ------- self
val fit_transform :
?y:[> `ArrayLike ] Np.Obj.t ->
?fit_params:(string * Py.Object.t) list ->
x:[> `ArrayLike ] Np.Obj.t ->
[> tag ] Obj.t ->
[> `ArrayLike ] Np.Obj.tFit 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 : array-like, sparse matrix, dataframe of shape (n_samples, n_features)
y : ndarray of shape (n_samples,), default=None Target values.
**fit_params : dict Additional fit parameters.
Returns ------- X_new : ndarray array of shape (n_samples, n_features_new) Transformed array.
Get parameters for this estimator.
Parameters ---------- deep : bool, default=True If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns ------- params : mapping of string to any Parameter names mapped to their values.
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.
Parameters ---------- **params : dict Estimator parameters.
Returns ------- self : object Estimator instance.
Project the data by using matrix product with the random matrix
Parameters ---------- X : numpy array or scipy.sparse of shape n_samples, n_features The input data to project into a smaller dimensional space.
Returns ------- X_new : numpy array or scipy sparse of shape n_samples, n_components Projected array.
Pretty-print the object to a formatter.