Spinner logo OtasAI


Did You Know?

Naive Bayes ComplementNB parameters


In the dynamic field of machine learning, the ability to efficiently create, train, and evaluate models is critical for both beginners and experienced data scientists. OtasML stands out as a visual machine-learning tool designed to simplify these processes, enabling users to interact intuitively with complex algorithms. This article delves into the specifics of Naive Bayes, particularly the ComplementNB classifier, within OtasML, and explains how various configurations can be adjusted for optimal model performance.

Configurations page:

The Configurations page is where users can fine-tune the settings of the ComplementNB classifier. Let’s explore these parameters in detail:


  • Default Value: 1.0
  • Description: It is a smoothing parameter used in the calculation of probabilities, and it is used to add smoothing to the probabilities calculated during the training phase. Smoothing is often employed to prevent zero probabilities and mitigate the impact of missing features in the training data, which could lead to unreliable probability estimates.
  • Warning: Set alpha=0 and force alpha=True, for no smoothing

Force Alpha

  • Default Value: True
  • Description: If False and alpha is less than 1e-10, it will set alpha to 1e-10. If True, alpha will remain unchanged. This may cause numerical errors if alpha is too close to 0.

Fit Prior

  • Default Value: True
  • Description: It is used to control whether or not class priors should be learned from the training data. Class priors are the probabilities of each class occurring in the dataset, and they play a role in the Naive Bayes algorithm's probability calculations.
    • True: Class priors are learned from the training data, meaning they are estimated based on the relative frequencies of each class.
    • False: Equal prior probabilities are assumed for all classes, rather than being learned from the data.


  • Default Value: False
  • Description: It is related to the weighting and normalization of features in the ComplementNB algorithm. In machine learning, normalization of feature weights can help improve the convergence and performance of certain algorithms. When the norm is set to True, a second normalization of the weights is applied. The default behavior, which is False, doesn't perform the second normalization step.

Test Size

  • Default Value: 0.2
  • Description: The test size parameter is used when splitting the dataset into these subsets, and it specifies the portion of the data that will be used for testing.

Train Size

  • Default Value: 0.8
  • Description: The train size parameter is used when splitting the dataset into these subsets, and it specifies the portion of the data that will be used for model training.


OtasML provides a user-friendly interface for configuring the ComplementNB classifier. By understanding and utilizing the detailed configurations available, users can fine-tune their models to achieve the best performance on their datasets. Whether adjusting the alpha parameter for smoothing, setting the appropriate train-test split, or normalizing feature weights, OtasML empowers users to build accurate and reliable models with ease. Explore OtasML today and elevate your data science projects with visual machine learning.

Last update: May 31, 2024


A+ A-