Naive Bayes Algorithm

Naive Bayes is a lightweight classification algorithm.

About the Algorithm

Naive Bayes is fast, requires little memory, and in many applications behaves quite satisfactorily, so you can use it first before going to the decision tree or fully fledged clustering schemes.

This algorithm predicts class membership probabilities. The algorithm treats all attributes of the case vector as if they were independent of each other. It uses a training sequence of vectors and the theoretical definition of the conditional probability to calculate the probabilities, or likelihoods, that an attribute with a certain value belongs to a case with a certain class. The model stores the probabilities. In the apply mode the case attributes are used to calculate the probability of the case for each class. Then a class with the maximal probability is assigned to the case.

Parameter Values

The naive Bayes algorithm enables you to specify both categorical and numerical accessors, or one or the other alone. The following table shows the parameters for the naive Bayes algorithm.

Predictor and Target Values

The naive Bayes algorithm enables you to specify both categorical and numerical accessors, only categorical accessors, or only numerical accessors. The following tables show the required and optional predictors and targets for naive Bayes.

Table 7. Categorical Predictors

Member Expression

Sample

CategoricalPredictor.CategorialPredictor specifies member or member set to use for the predictor domain.

{[Analog]}

CategoricalPredictor.Sequence defines the sequence to be traversed for the predictor, generally a time dimension range.

{[Jan 1].Level.Members}

CategoricalPredictor.External (optional) defines the scope of the predictor.

(none available)

CategoricalPredictor.Anchor (optional) specifies additional restrictions from other dimensions.

{([2001], [Actual], [Sales], [San_Francisco])}

Table 8. Numerical Predictors

Member Expression

Sample

NumericalPredictor.NumericalPredictor specifies member or member set to use for the predictor domain.

{[Wireless]}

NumericalPredictor.Sequence defines the sequence to be traversed for the predictor, generally a time dimension range.

{[Jan 1].Level.Members}

NumericalPredictor.External (optional) defines the scope of the predictor.

(none available)

NumericalPredictor.Anchor (optional) specifies additional restrictions from other dimensions.

{([2001], [Actual], [Sales], [San_Francisco])}

Table 9. Targets

Target Expression

Example

Target.Target specifies single member to use for the target domain.

{[Phones]}

Target.Sequence defines the sequence to be traversed for the target, generally a time dimension range.

{[Jan 1].Level.Members}

Target.External (optional) defines the scope of the target.

(none available)

Target.Anchor (optional) specifies additional restrictions from other dimensions.

{([2001], [Actual], [Sales], [San_Francisco])}

Model Data

This information will be made available at a later release.

Result Data

The following table describes the result data for the Naive Bayes algorithm.

Result

Description

Category

Input target attributes, also called classes

CategoryProb

Categorical attributes probabilities

Class

Class values

ClassProb

A priori class probabilities

Range

Numerical attribute ranges

RangeProb

Attribute range probabilities

Related Information