Naive Bayes#

class legate_raft.sklearn.naive_bayes.MultinomialNB(alpha: float = 1.0)#

Naive Bayes classifier similar to sklearn.naive_bayes.MultinomialNB.

Meant to be used together with the the HashingVectorizer and TfidfTransformer.

Parameters:

alpha (float, default=1.0) – Smoothing parameter.

fit(X: csr_array | csr_matrix | coo_array | coo_matrix | COOStore, y: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | LogicalStore) MultinomialNB#

Fit naive bayes classifier.

Parameters:
  • X (SparseArray or COOStore) – The input for X is currently meant to be the result of the TfidfTransformer.

  • y (logical store) – The target values.

predict(X: csr_array | csr_matrix | coo_array | coo_matrix | COOStore | PartitionedCOOStore, *, batch_size=None) LogicalStore#

Predict classes for X.