lale.lib.autogen.dictionary_learning module

class lale.lib.autogen.dictionary_learning.DictionaryLearning(*, n_components=None, alpha=1, max_iter=1000, tol=1e-08, fit_algorithm='lars', transform_algorithm='omp', transform_n_nonzero_coefs=None, transform_alpha=None, n_jobs=1, code_init=None, dict_init=None, verbose=False, split_sign=False, random_state=None, positive_code=False, positive_dict=False, callback=None)

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 dictionary elements to extract

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

    • or None

  • alpha (float, >=1e-10 for optimizer, <=1.0 for optimizer, loguniform distribution, default 1) – sparsity controlling parameter

  • max_iter (integer, >=10 for optimizer, <=1000 for optimizer, uniform distribution, default 1000) – maximum number of iterations to perform

  • tol (float, >=1e-08 for optimizer, <=0.01 for optimizer, default 1e-08) – tolerance for numerical error

  • fit_algorithm (‘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)

  • transform_algorithm (‘lasso_lars’, ‘lasso_cd’, ‘lars’, ‘omp’, or ‘threshold’, default ‘omp’) – Algorithm used to transform the data lars: uses the least angle regression method (linear_model.lars_path) lasso_lars: uses Lars to compute the Lasso solution lasso_cd: uses the coordinate descent method to compute the Lasso solution (linear_model.Lasso)

  • transform_n_nonzero_coefs (None, not for optimizer, default None) – Number of nonzero coefficients to target in each column of the solution

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

    If algorithm=’lasso_lars’ or algorithm=’lasso_cd’, alpha is the penalty applied to the L1 norm

    • float

    • or None

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

    Number of parallel jobs to run

    • integer

    • or None

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

    initial value for the code, for warm restart

    • array of items : array of items : float

    • or None

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

    initial values for the dictionary, for warm restart

    • array of items : array of items : float

    • or None

  • verbose (boolean, not for optimizer, default False) – To control the verbosity of the procedure.

  • split_sign (boolean, not for optimizer, default False) – Whether to split the sparse feature vector into the concatenation of its negative part and its positive part

  • 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

  • positive_code (boolean, not for optimizer, default False) – Whether to enforce positivity when finding the code

  • positive_dict (boolean, not for optimizer, default False) – Whether to enforce positivity when finding the dictionary

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

    Callable that gets invoked every five iterations.

    • callable, not for optimizer

    • or None

Notes

constraint-1 : any type

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.

Returns

result – Transformed data

Return type

array of items : array of items : float