lale.lib.sklearn.mlp_classifier module

class lale.lib.sklearn.mlp_classifier.MLPClassifier(*, hidden_layer_sizes=['100'], activation='relu', solver='adam', alpha=0.0001, batch_size='auto', learning_rate='constant', learning_rate_init=0.001, power_t=0.5, max_iter=200, shuffle=True, random_state=None, tol=0.0001, verbose=False, warm_start=False, momentum=0.9, nesterovs_momentum=True, early_stopping=False, validation_fraction=0.1, beta_1=0.9, beta_2=0.999, epsilon=1e-08, n_iter_no_change=10, max_fun=15000)

Bases: PlannedIndividualOp

Multi-layer perceptron dense deep neural network from scikit-learn for classification.

This documentation is auto-generated from JSON schemas.

Parameters
  • hidden_layer_sizes (tuple, >=1 items for optimizer, <=20 items for optimizer, default [100] of items : integer, >=1 for optimizer, <=500 for optimizer) – The ith element represents the number of neurons in the ith hidden layer.

  • activation (‘identity’, ‘logistic’, ‘tanh’, or ‘relu’, default ‘relu’) – Activation function for the hidden layer.

  • solver (‘lbfgs’, ‘sgd’, or ‘adam’, default ‘adam’) – The solver for weight optimization.

  • alpha (float, >=1e-10 for optimizer, <=1 for optimizer, loguniform distribution, default 0.0001) – L2 penalty (regularization term) parameter.

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

    Size of minibatches for stochastic optimizers.

    • integer, >=3 for optimizer, <=128 for optimizer, uniform distribution

      Size of minibatches

    • or ‘auto’

      Automatic selection, batch_size=min(200, n_samples)

  • learning_rate (‘constant’, ‘invscaling’, or ‘adaptive’, default ‘constant’) – Learning rate schedule for weight updates.

  • learning_rate_init (float, >0, <=0.1 for optimizer, not for optimizer, default 0.001) – The initial learning rate used. It controls the step-size in updating the weights.

  • power_t (float, >=0.01 for optimizer, <=10 for optimizer, not for optimizer, default 0.5) – The exponent for inverse scaling learning rate.

  • max_iter (integer, >=1, >=10 for optimizer, <=1000 for optimizer, uniform distribution, not for optimizer, default 200) – Maximum number of iterations. The solver iterates until convergence (determined by “tol”) or this number of iterations.

  • shuffle (boolean, not for optimizer, default True) – Whether to shuffle samples in each iteration.

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

    Random generator selection

    • integer

      seed used by the random number generators

    • or numpy.random.RandomState

      Random number generator

    • or None

      RandomState instance used by np.random

  • tol (float, >=1e-08 for optimizer, <=0.01 for optimizer, default 0.0001) – Tolerance for the optimization. When the loss or score is not improving by at least tol for n_iter_no_change consecutive iterations, unless learning_rate is set to “adaptive”, convergence is considered to be reached and training stops.

  • verbose (boolean, not for optimizer, default False) – Whether to print progress messages to stdout.

  • 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.

  • momentum (float, >=0, <=1, default 0.9) – Momentum for gradient descent update.

  • nesterovs_momentum (boolean, default True) – Whether to use Nesterov’s momentum.

  • early_stopping (boolean, default False) – Whether to use early stopping to terminate training when validation score is not improving. If set to true, it will automatically set aside 10% of training data as validation and terminate training when validation score is not improving by at least tol for n_iter_no_change consecutive epochs.

  • validation_fraction (float, >=0.0, <=1.0, default 0.1) – The proportion of training data to set aside as validation set for early stopping.

  • beta_1 (float, >=0.0, <1.0, default 0.9) – Exponential decay rate for estimates of first moment vector in adam.

  • beta_2 (float, >=0.0, <1.0, default 0.999) – Exponential decay rate for estimates of second moment vector in adam.

  • epsilon (float, >=1e-08 for optimizer, <=1.35 for optimizer, loguniform distribution, default 1e-08) – Value for numerical stability in adam.

  • n_iter_no_change (integer, >=1, <=50 for optimizer, not for optimizer, default 10) – Maximum number of epochs to not meet tol improvement.

  • max_fun (integer, >=0, optional, not for optimizer, default 15000) – Maximum number of loss function calls.

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) –

  • y (union type) –

    • array of items : string

    • or array of items : float

    • or array of items : boolean

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

Incremental fit to train train the operator on a batch of samples.

Note: The partial_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) –

  • y (union type) –

    • array of items : string

    • or array of items : float

    • or array of items : boolean

  • classes (union type, optional) –

    • array of items : string

    • or array of items : float

    • or array of items : boolean

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 (array of items : array of items : float) –

Returns

result

  • array of items : string

  • or array of items : float

  • or array of items : boolean

Return type

union type

predict_proba(X)

Probability estimates for all classes.

Note: The predict_proba 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) –

Returns

result

Return type

array of items : array of items : float