lale.lib.autogen.elastic_net_cv module

class lale.lib.autogen.elastic_net_cv.ElasticNetCV(*, l1_ratio=0.5, eps=0.001, n_alphas=100, alphas=None, fit_intercept=True, precompute='auto', max_iter=1000, tol=0.0001, cv, copy_X=True, verbose=0, n_jobs=1, positive=False, random_state=None, selection='cyclic')

Bases: PlannedIndividualOp

Combined schema for expected data and hyperparameters.

This documentation is auto-generated from JSON schemas.

Parameters
  • l1_ratio (float, >=0.0 for optimizer, <=1.0 for optimizer, uniform distribution, default 0.5) –

    float between 0 and 1 passed to ElasticNet (scaling between l1 and l2 penalties)

    See also constraint-1.

  • eps (float, >=0.001 for optimizer, <=0.1 for optimizer, loguniform distribution, default 0.001) – Length of the path

  • n_alphas (integer, >=100 for optimizer, <=101 for optimizer, uniform distribution, default 100) – Number of alphas along the regularization path, used for each l1_ratio.

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

    List of alphas where to compute the models

    • array of items : Any

    • or None

    See also constraint-1.

  • fit_intercept (boolean, default True) – whether to calculate the intercept for this model

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

    Whether to use a precomputed Gram matrix to speed up calculations

    • array, not for optimizer of items : Any

    • or ‘auto’

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

  • tol (float, >=1e-08 for optimizer, <=0.01 for optimizer, default 0.0001) – The tolerance for the optimization: if the updates are smaller than tol, the optimization code checks the dual gap for optimality and continues until it is smaller than tol.

  • cv (union type) –

    Cross-validation as integer or as object that has a split function.

    The fit method performs cross validation on the input dataset for per trial, and uses the mean cross validation performance for optimization. This behavior is also impacted by handle_cv_failure flag. If integer: number of folds in sklearn.model_selection.StratifiedKFold. If object with split function: generator yielding (train, test) splits as arrays of indices. Can use any of the iterators from https://scikit-learn.org/stable/modules/cross_validation.html#cross-validation-iterators.

    • integer, >=1, >=3 for optimizer, <=4 for optimizer, uniform distribution, default 5

    • or Any, not for optimizer

  • copy_X (boolean, default True) – If True, X will be copied; else, it may be overwritten.

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

    Amount of verbosity.

    • boolean

    • or integer

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

    Number of CPUs to use during the cross validation

    • integer

    • or None

  • positive (boolean, default False) – When set to True, forces the coefficients to be positive.

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

    The seed of the pseudo random number generator that selects a random feature to update

    • integer

    • or numpy.random.RandomState

    • or None

  • selection (‘random’ or ‘cyclic’, default ‘cyclic’) – If set to ‘random’, a random coefficient is updated every iteration rather than looping over features sequentially by default

Notes

constraint-1 : union type

From /linear_model/_coordinate_descent.py:None:_alpha_grid, Exception: raise ValueError( Automatic alpha grid generation is not supported for l1_ratio=0. Please supply a grid by providing your estimator with the appropriate alphas= argument.

  • alphas : negated type of None

  • or l1_ratio : negated type of 0

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 (Any) – Training data

  • y (union type) –

    Target values

    • array of items : float

    • or array of items : array of items : float

predict(X, **predict_params)

Make predictions.

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

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

Parameters

X (union type) –

Samples.

  • array of items : Any

  • or array of items : array of items : float

Returns

result – Returns predicted values.

Return type

array of items : float