NaiveBayesOptions<T>
Options & Configuration · AiDotNet.Models.Options
Configuration options for Naive Bayes classifiers.
Inheritance: ModelOptions → ClassifierOptions<T> → NaiveBayesOptions<T>
For Beginners
Naive Bayes is one of the simplest and most effective classifiers.
How it works:
- During training, it learns the probability of each class and the probability of
each feature value given each class
- During prediction, it uses Bayes’ theorem to calculate the probability of each class
given the observed features
- It returns the class with the highest probability
The “naive” assumption is that features are independent given the class. For example, in spam detection, the words “free” and “win” might both indicate spam, but the model assumes they contribute independently to that prediction.
Despite this unrealistic assumption, Naive Bayes often works surprisingly well!
How It Works
Naive Bayes classifiers are probabilistic classifiers based on Bayes’ theorem with the “naive” assumption of conditional independence between features given the class label. Despite this simplifying assumption, Naive Bayes often performs well in practice.
Constructors
| Constructor | Summary |
|---|---|
NaiveBayesOptions() |
Properties
| Property | Summary |
|---|---|
bool FitPriors { get; set; } |
Gets or sets whether to fit class prior probabilities from the data. |
double Alpha { get; set; } |
Gets or sets the smoothing parameter (alpha) for Laplace/additive smoothing. |
double MinVariance { get; set; } |
Gets or sets the minimum variance for Gaussian Naive Bayes. |
double[] ClassPriors { get; set; } |
Gets or sets custom class prior probabilities. |