lale.lib.autogen.mini_batch_sparse_pca module

class lale.lib.autogen.mini_batch_sparse_pca.MiniBatchSparsePCA(*, n_components=None, alpha=1, ridge_alpha=0.01, callback=None, batch_size=3, verbose=False, shuffle=True, n_jobs=1, method='lars', random_state=None, max_no_improvement=10, tol=0.001, max_iter=1000)

Bases: PlannedIndividualOp

Combined schema for expected data and hyperparameters.

This documentation is auto-generated from JSON schemas.

Parameters
  • n_components (union type, default None) –

    number of sparse atoms to extract

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

    • or None

  • alpha (integer, >=1 for optimizer, <=2 for optimizer, uniform distribution, default 1) – Sparsity controlling parameter

  • ridge_alpha (float, not for optimizer, default 0.01) – Amount of ridge shrinkage to apply in order to improve conditioning when calling the transform method.

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

    callable that gets invoked every five iterations

    • callable

    • or None

  • batch_size (integer, >=3 for optimizer, <=128 for optimizer, uniform distribution, default 3) – the number of features to take in each mini batch

  • verbose (union type, not for optimizer, default False) –

    Controls the verbosity; the higher, the more messages

    • integer

    • or boolean

  • shuffle (boolean, default True) – whether to shuffle the data before splitting it in batches

  • n_jobs (union type, not for optimizer, default 1) –

    Number of parallel jobs to run

    • integer

    • or None

  • method (‘lars’ or ‘cd’, default ‘lars’) – lars: uses the least angle regression method to solve the lasso problem (linear_model.lars_path) cd: uses the coordinate descent method to compute the Lasso solution (linear_model.Lasso)

  • random_state (union type, not for optimizer, 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 np.random.

    • integer

    • or numpy.random.RandomState

    • or None

  • max_no_improvement (union type, optional, not for optimizer, default 10) –

    Control early stopping based on the consecutive number of mini batches that does not yield an improvement on the smoothed cost function.

    • integer, >=1

    • or None

      Disable convergence detection based on cost function.

  • tol (float, optional, not for optimizer, default 0.001) –

    Control early stopping based on the norm of the differences in the dictionary between 2 steps.

    To disable early stopping based on changes in the dictionary, set tol to 0.0.

  • max_iter (union type, optional, not for optimizer, default 1000) –

    Maximum number of iterations over the complete dataset before stopping independently of any early stopping criterion heuristics.

    • integer, >=5 for optimizer, <=1000 for optimizer, uniform distribution

    • or None

      deprecated

Notes

constraint-1 : negated type of ‘X/isSparse’

A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.

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 (array of items : array of items : float) – Training vector, where n_samples in the number of samples and n_features is the number of features.

  • y (any type) –

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 (array of items : array of items : float) – Test data to be transformed, must have the same number of features as the data used to train the model.

  • ridge_alpha (float, optional, default 0.01) – Amount of ridge shrinkage to apply in order to improve conditioning

Returns

result – Transformed data.

Return type

Any