dask_ml.naive_bayes.GaussianNB

class dask_ml.naive_bayes.GaussianNB(priors=None, classes=None)

Fit a naive bayes model with a Gaussian likelihood

Examples

>>> from dask_ml import datasets
>>> from dask_ml.naive_bayes import GaussianNB
>>> X, y = datasets.make_classification(chunks=50)
>>> gnb = GaussianNB()
>>> gnb.fit(X, y)

Methods

get_params([deep]) Get parameters for this estimator.
predict(X) Perform classification on an array of test vectors X.
predict_log_proba(X) Return log-probability estimates for the test vector X.
predict_proba(X) Return probability estimates for the test vector X.
set_params(**params) Set the parameters of this estimator.
fit  
__init__(priors=None, classes=None)

Initialize self. See help(type(self)) for accurate signature.

get_params(deep=True)

Get parameters for this estimator.

Parameters:
deep : bool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:
params : dict

Parameter names mapped to their values.

predict(X)

Perform classification on an array of test vectors X. Parameters ———- X : array-like, shape = [n_samples, n_features] Returns ——- C : array, shape = [n_samples]

Predicted target values for X
predict_log_proba(X)

Return log-probability estimates for the test vector X. Parameters ———- X : array-like, shape = [n_samples, n_features] Returns ——- C : array-like, shape = [n_samples, n_classes]

Returns the log-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_.
predict_proba(X)

Return probability estimates for the test vector X. Parameters ———- X : array-like, shape = [n_samples, n_features] Returns ——- C : array-like, shape = [n_samples, n_classes]

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_.
set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:
**params : dict

Estimator parameters.

Returns:
self : estimator instance

Estimator instance.