When to use it
Predict a categorical outcome (2+ classes) from continuous and/or categorical predictors when you want a fast, robust baseline classifier that handles many predictors and small samples well: at the cost of assuming predictors are independent within each class.
When not to: Predictors are strongly correlated with each other within classes AND that correlation carries real classification information (LDA or logistic regression handle correlated predictors more gracefully), you need well-CALIBRATED probability estimates rather than just correct rankings (Naive Bayes' probabilities tend to be overconfident), or the outcome is severely imbalanced without checking accuracy against the no-information rate.
Step by step
Open it from the menu
Click Multivariate & ML in the menu bar; under Classification choose Naive Bayes Classifier.
Fill in the form
Choose the columns: Groups to predict, Columns that may explain it. The form lists only columns whose type fits each field.
Check the options
The options start at their defaults: Variance smoothing, Laplace smoothing (α), CV folds. Change one only when your question needs it.
Run the analysis
Press Run analysis. The Result Card opens on its Results tab.
What to choose in the form
| Groups to predict Outcome required | One categorical or binary or ordered categorical column. Categorical outcome to classify (2–20 classes). |
|---|---|
| Columns that may explain it Predictors required | One numeric or categorical or ordered categorical or binary column. Predictor columns. Numeric columns get Gaussian densities; text/categorical columns get smoothed conditional tables. |
| Variance smoothing | Fraction of the largest feature variance added to all Gaussian variances for numerical stability. Default: 1e-9. |
| Laplace smoothing (α) | Add-α smoothing for categorical conditional tables; fixes the zero-frequency problem. 1.0 = classic Laplace. Default: 1. |
| CV folds | Stratified cross-validation folds for honest accuracy (seeded, random_state=42). 0 disables CV. Default: 5. |
How to read the card
The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.
What it assumes
- Normality (of residuals, not of the raw data)
If it does not hold: Gaussian Naive Bayes models each continuous predictor as normally distributed within each class; strongly skewed predictors violate this, though the classifier is fairly robust to mild non-normality since usually only the class ranking of probabilities, not their exact values, needs to be right.
How to check: Checked directly: the card computes the largest within-class skewness across the continuous predictors (for classes with at least 8 values and non-zero variance) and flags it as a warning above 2.0.
A worked example
Classifying penguin species from bill length (continuous) and island (categorical), with 5-fold cross-validation and default smoothing.
Result: In-sample accuracy = 96.2%, cross-validated accuracy = 95.6% (a 0.6-point gap, far below the 5-point flag threshold; fold accuracies 92.6% to 98.6%); no-information rate = 44.2%.
The small in-sample/CV gap suggests the model is not substantially overfitting, and the large margin over the no-information rate confirms it is genuinely using the predictors' information rather than merely reflecting the class imbalance; 95.6% is the honest number to report.
From the Statistics Library.
The code tabs
Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.
Understand the statistics
Ask Oobi
Type one of these into Ask Oobi beside your data:
- Can bill length and island predict a penguin's species?
- Explain the naive Bayes classifier in plain words.
- What does cross-validation mean?
Last reviewed November 16, 2026.
