Receive error "Zero Standard deviation for the conditional distribution ..." when using the Naive Bayes module

Receive error "Zero Standard deviation for the conditional distribution ..." when using the Naive Bayes module

book

Article ID: KB0074392

calendar_today

Updated On:

Products Versions
Spotfire Statistica 12.6 and higher

Description

When using the Naive Bayes module under the Machine Learning, you may encounter the following problem:

Receive error message : "Zero standard deviation for the conditional distribution of the independent variable XXX. Please carefully check your data set and try again."

When the sample size is small under some levels of the dependent variable, the above error message may appear. There are two potential causes:

1. The conditional distribution of the independent variable informed in the error message has zero standard deviation given a certain level of the dependent variable.

2. The default sampling procedure randomly splits the data into a training set and a testing set at a size of ratio of 3:1. This leads the training set to  the case described in cause 1.

Issue/Introduction

Receive error "Zero Standard deviation for the conditional distribution ..." when using the Naive Bayes module

Environment

Windows

Resolution

WORKAROUND:

Step 1. Check the data set to ensure none of the independent variables (continuous) has conditional distribution with zero standard deviation. i.e. at least two samples with different value available at each level of the dependent variable 

Step 2. If pass step 1, select "Sampling" Tab in the Naive Bayes analysis dialog and adjust the sampling method to avoid zero standard deviation for the conditional distribution of any independent variable in the training set.

Introduction of each sampling option can be found in the e-manual by clicking "?' at the dialog. Below is the default setting.