lale.lib.autogen.sparse_random_projection module

class lale.lib.autogen.sparse_random_projection.SparseRandomProjection(*, n_components='auto', density='auto', eps=0.1, dense_output=False, random_state=None)

Bases: PlannedIndividualOp

Combined schema for expected data and hyperparameters.

This documentation is auto-generated from JSON schemas.

Parameters
  • n_components (union type, default 'auto') –

    Dimensionality of the target projection space

    • integer, >=2 for optimizer, <=256 for optimizer, uniform distribution

    • or ‘auto’

  • density (union type, default 'auto') –

    Ratio of non-zero component in the random projection matrix

    • ’auto’

    • or float, >=0 for optimizer, <=1 for optimizer, uniform distribution

  • eps (float, >=0.001 for optimizer, <=0.1 for optimizer, loguniform distribution, default 0.1) – Parameter to control the quality of the embedding according to the Johnson-Lindenstrauss lemma when n_components is set to ‘auto’

  • dense_output (boolean, default False) – If True, ensure that the output of the random projection is a dense numpy array even if the input and random projection matrix are both sparse

  • random_state (union type, not for optimizer, default None) –

    Control the pseudo random number generator used to generate the matrix at fit time

    • integer

    • or numpy.random.RandomState

    • or None

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (union type) –

    Training set: only the shape is used to find optimal random matrix dimensions based on the theory referenced in the afore mentioned papers.

    • array of items : Any

    • or array of items : array of items : float

  • y (Any) – Ignored

transform(X, y=None)

Transform the data.

Note: The transform method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (union type) –

The input data to project into a smaller dimensional space.

  • array of items : Any

  • or array of items : array of items : float

Returns

result – Projected array.

  • array of items : Any

  • or array of items : array of items : float

Return type

union type