File Exchange

image thumbnail

Gaussian Naive Bayes (GNB) Classifier

version 1.1.5 (2.92 KB) by David Ferreira
Complete package

23 Downloads

Updated 31 May 2020

GitHub view license on GitHub

Function
1. predict_gnb
2. find_gnb

Syntax
1. [label,accuracy] = predict_gnb(X,Y,Xnew,Ynew)
2. [labels,probabilities] = find_gnb(X,Y,Xnew)

Description
1. Returns the estimated labels of one or multiple test instances and the accuracy of the estimates.
2. Returns the labels with their respective probabilities in descending order.

Examples
1.
load fisheriris
X = meas;
Y = species;
Xnew = [min(meas);mean(meas);max(meas)];
Ynew = {'versicolor';'versicolor';'virginica'};
[label,accuracy] = predict_gnb(X,Y,Xnew,Ynew)
label =
'setosa'
'versicolor'
'virginica'
accuracy =
0.6667

2.
[labels,probabilities] = find_gnb(X,Y,Xnew)
labels =
'versicolor'
'virginica'
'setosa'
probabilities =
1.0000
0.0000
0.0000

See more examples described in the script files.

Cite As

David Ferreira (2020). Gaussian Naive Bayes (GNB) Classifier (https://github.com/ferreirad08/Gaussian-Naive-Bayes-GNB-Classifier/releases/tag/1.1.5), GitHub. Retrieved .

Comments and Ratings (1)

Updates

1.1.5

See release notes for this release on GitHub: https://github.com/ferreirad08/Gaussian-Naive-Bayes-GNB-Classifier/releases/tag/1.1.5

1.1.4

See release notes for this release on GitHub: https://github.com/ferreirad08/Gaussian-Naive-Bayes-GNB-Classifier/releases/tag/1.1.4

1.1.3

See release notes for this release on GitHub: https://github.com/ferreirad08/Gaussian-Naive-Bayes-GNB-Classifier/releases/tag/1.1.3

1.1.2

See release notes for this release on GitHub: https://github.com/ferreirad08/Gaussian-Naive-Bayes-GNB-Classifier/releases/tag/1.1.2

1.0.2

Matrix operation in the probability density function (PDF) of the normal distribution.

1.0.1

Class prior probability added.

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