lale.lib.autogen.perceptron module

class lale.lib.autogen.perceptron.Perceptron(*, penalty=None, alpha=0.0001, fit_intercept=True, max_iter=None, tol=None, shuffle=True, verbose=0, eta0=1.0, n_jobs=1, random_state=None, early_stopping=False, validation_fraction=0.1, n_iter_no_change=5, class_weight='balanced', warm_start=False)

Bases: PlannedIndividualOp

Combined schema for expected data and hyperparameters.

This documentation is auto-generated from JSON schemas.

Parameters
  • penalty (None, not for optimizer, default None) – The penalty (aka regularization term) to be used

  • alpha (float, >=1e-10 for optimizer, <=1.0 for optimizer, loguniform distribution, default 0.0001) – Constant that multiplies the regularization term if regularization is used

  • fit_intercept (boolean, default True) – Whether the intercept should be estimated or not

  • max_iter (union type, default None) –

    The maximum number of passes over the training data (aka epochs)

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

    • or None

  • tol (union type, default None) –

    The stopping criterion

    • float, >=1e-08 for optimizer, <=0.01 for optimizer

    • or None

  • shuffle (boolean, default True) – Whether or not the training data should be shuffled after each epoch.

  • verbose (integer, not for optimizer, default 0) – The verbosity level

  • eta0 (float, >=0.01 for optimizer, <=1.0 for optimizer, loguniform distribution, default 1.0) – Constant by which the updates are multiplied

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

    The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation

    • integer

    • or None

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

    The seed of the pseudo random number generator to use when shuffling the data

    • integer

    • or numpy.random.RandomState

    • or None

  • early_stopping (boolean, not for optimizer, default False) –

    Whether to use early stopping to terminate training when validation

    See also constraint-2.

  • validation_fraction (float, not for optimizer, default 0.1) –

    The proportion of training data to set aside as validation set for early stopping

    See also constraint-2.

  • n_iter_no_change (integer, not for optimizer, default 5) – Number of iterations with no improvement to wait before early stopping

  • class_weight ('balanced', not for optimizer, default 'balanced') – Preset for the class_weight fit parameter

  • warm_start (boolean, not for optimizer, default False) – When set to True, reuse the solution of the previous call to fit as initialization, otherwise, just erase the previous solution

Notes

constraint-1 : any type

constraint-2 : union type

validation_fraction, only used if early_stopping is true

  • validation_fraction : 0.1

  • or early_stopping : True

decision_function(X)

Confidence scores for all classes.

Note: The decision_function 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 – Confidence scores per (sample, class) combination

Return type

Any

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 data

  • y (array of items : float) – Target values

  • coef_init (array, optional of items : array of items : float) – The initial coefficients to warm-start the optimization.

  • intercept_init (array, optional of items : float) – The initial intercept to warm-start the optimization.

  • sample_weight (union type, optional, default None) –

    Weights applied to individual samples

    • array of items : float

    • or None

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 – Predicted class label per sample.

Return type

array of items : float