lale.lib.sklearn.multinomial_nb module

class lale.lib.sklearn.multinomial_nb.MultinomialNB(*, alpha=1.0, fit_prior=True, class_prior=None, force_alpha=True)

Bases: PlannedIndividualOp

Multinomial Naive Bayes classifier from scikit-learn.

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

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

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

    Prior probabilities of the classes. If specified the priors are not adjusted according to the data.

    • array of items : float

    • or None

  • force_alpha (boolean, optional, not for optimizer, default True) – If False and alpha is less than 1e-10, it will set alpha to 1e-10. If True, alpha will remain unchanged. This may cause numerical errors if alpha is too close to 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) –

  • y (union type) –

    • array of items : string

    • or array of items : float

    • or array of items : boolean

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

    Weights applied to individual samples.

    • array of items : float

    • or None

      Uniform weights.

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

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

    Weights applied to individual samples.

    • array of items : float

    • or None

      Uniform weights.

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 – Returns the probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute classes_.

Return type

array of items : array of items : float