> For the complete documentation index, see [llms.txt](https://hwasumok.gitbook.io/r-flow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hwasumok.gitbook.io/r-flow/python/machine-learning/naive-bayes.md).

# Naive Bayes

BernoulliNB/CategoricalNB/ComplementNB/GaussianNB/MultinomialNB

## Common

### Input Data

|                    | Inputs                                                                                                                             |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| **\*Target Data**  | Data Input                                                                                                                         |
| **\*Model Name**   | Name of the user-defined Bayes model                                                                                               |
| **Predict Output** | <p>If not empty, the model will additionally make prediction on <strong>Target Data</strong> and store</p><p> the result here.</p> |
| **Merge Data**     | Predict Output will be created with predicted labels concatenated to Merge Data.                                                   |
| **\*x (numeric)**  | <p>User-selected columns to be x.</p><ul><li>One or more columns should be selected.</li></ul>                                     |
| **\*y**            | <p>User-selected columns to be y.</p><ul><li>Only one column should be selected.</li></ul>                                         |

###

![\[Task information of GaussianNB\]](https://3929524962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGaxNdSdRN_L_WNiX4I%2F-MKZWXEEu4jTEQfyAkur%2F-MKZWcEO1m70odeVgXct%2Fimage.png?alt=media\&token=03d084ae-ccac-4571-8414-cd4fa6760104)

## Workflow Example

![](https://3929524962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGaxNdSdRN_L_WNiX4I%2F-MLO9q4PahADFDgUsyLi%2F-MLOEi1aTxoPr2Pfki-l%2Fimage.png?alt=media\&token=4e01c82a-f94e-411a-a1c9-f54533244321)

## Python Package

**BernoulliNB**: <https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.BernoulliNB.html>

**CategoricalNB**: <https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.CategoricalNB.html>

**ComplementNB**: <https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.ComplementNB.html>

**GaussianNB**: <https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html>

**MultinomialNB**: <https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.MultinomialNB.html>
