ddl.linear.RandomOrthogonalEstimator

class ddl.linear.RandomOrthogonalEstimator(n_components=None, random_state=None)[source]

Bases: sklearn.base.BaseEstimator

Random linear orthogonal estimator.

Parameters:
n_components : int, default=n_features

Number of components to return from random orthogonal estimator. If n_components is 1, then a random direction is returned. Otherwise, return an truncated orthogonal matrix by only returning the first n_components columns.

random_state : int, RandomState instance or None, optional (default=None)

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by numpy.random.

Attributes:
components_ : array, shape (n_components, n_features)

Random matrix that is orthogonal if n_components = n_features. Otherwise, an orthogonal matrix that has been truncated to the first n_components columns.

Methods

fit(self, X[, y]) Fit estimator to X.
get_params(self[, deep]) Get parameters for this estimator.
set_params(self, \*\*params) Set the parameters of this estimator.
__init__(self, n_components=None, random_state=None)[source]

Initialize self. See help(type(self)) for accurate signature.

fit(self, X, y=None, **fit_params)[source]

Fit estimator to X.

Parameters:
X : array-like, shape (n_samples, n_features)

Training data, where n_samples is the number of samples and n_features is the number of features.

y : None, default=None

Not used in the fitting process but kept for compatibility.

fit_params : dict, optional

Optional extra fit parameters.

Returns:
self : estimator

Returns the instance itself.

get_params(self, deep=True)

Get parameters for this estimator.

Parameters:
deep : boolean, optional

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_params(self, **params)

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:
self