NB: Classification using Naive Bayes

NBR Documentation

Classification using Naive Bayes

Description

This function builds a classification model using Naive Bayes.

Usage

NB(
  train,
  labels,
  tune = FALSE,
  methodparameters = NULL,
  graph = FALSE,
  seed = NULL,
  ...
)

Arguments

train

The training set (description), as a data.frame.

labels

Class labels of the training set (vector or factor).

tune

If true, the function returns parameters instead of a classification model.

methodparameters

Present for interface consistency with performance (which always passes it when fitting a model). Currently unused: NB does not support reusing pre-tuned parameters.

graph

Present for interface consistency with performance (which always passes it when fitting a model). Currently unused: NB does not produce a plot.

seed

A specified seed for random number generation, so that two runs on the same data give the same model. Every learning method accepts it, so that it can be set the same way whatever the method; the deterministic ones simply have nothing to draw and give the same model with or without it.

...

Other parameters.

Value

The classification model.

See Also

naiveBayes

Examples

require (datasets)
data (iris)
NB (iris [, -5], iris [, 5])

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.