lale.lib.autogen.bernoulli_nb module

class lale.lib.autogen.bernoulli_nb.BernoulliNB(*, alpha=1.0, binarize=0.0, fit_prior=True, class_prior=None)

Bases: PlannedIndividualOp

Combined schema for expected data and hyperparameters.

This documentation is auto-generated from JSON schemas.

Parameters
  • alpha (float, >=1e-10 for optimizer, <=1.0 for optimizer, loguniform distribution, default 1.0) – Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).

  • binarize (union type, default 0.0) –

    Threshold for binarizing (mapping to booleans) of sample features

    • float, >=-1.0 for optimizer, <=1.0 for optimizer

    • or None

    See also constraint-1, constraint-1.

  • fit_prior (boolean, default True) – Whether to learn class prior probabilities or not

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

    Prior probabilities of the classes

    • array of items : float

    • or None

Notes

constraint-1 : union type

Cannot binarize a sparse matrix with threshold < 0

  • binarize : None

  • or negated type of ‘X/isSparse’

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

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

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

    Weights applied to individual samples (1

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

Returns

result – Predicted target values for X

Return type

array of items : float

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 – Returns the probability of the samples for each class in the model

Return type

array of items : array of items : float