File Exchange

image thumbnail

Naive Bayes Classifier

version (352 KB) by Indraneel Biswas
Script for Naive Bayes Classifier in Matlab 2008a


Updated 06 Aug 2012

View License

I use Matlab 2008a which does not support Naive Bayes Classifier. Script supports normal and kernel distributions. Statistics toolbox for 2008a version is used in the script. Also includes function for confusionmat
Sample data provided is from Mathworks Webinar: Computational Statistics: Getting Started with Classification Using MATLAB <>

Cite As

Indraneel Biswas (2020). Naive Bayes Classifier (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

hao zhang

Changbin Li

Hi Thanks for your code! I have a question. why did you use normcdf not normpdf?

can you please explain what are this coding for?
for i=1:length(id)

I have a question. Can you help me? Thanks.


can you tell me what does it mean please.


working well.. Thankx

I am running this code. But its showing error in Matlab 2014b
Undefined function 'cvpartition' for input arguments of type 'double'.

please help





A working implementation but it's too much oriented onto author's task.

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Introduction to Classification