Naive Bayes (NB) Classifier

版本 1.1.7 (3.2 KB) 作者: David Ferreira
Multi-class Classification with the NB
527.0 次下载
更新时间 2020/11/10

Function
1. NaiveBayes.predict(_)
2. NaiveBayes.find(_)

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 using Iris Data Set

load fisheriris

X = meas;
Y = species;
Xnew = [min(X);mean(X);max(X)];

mdl = NaiveBayes('gaussian');
mdl = mdl.fit(X,Y)
Ypred = mdl.predict(Xnew)

Ypred =

'setosa'
'versicolor'
'virginica'


Ynew = {'versicolor';'versicolor';'virginica'};
accuracy = accuracy_score(Ypred,Ynew)

accuracy =

0.6667

See more examples described in the script files.

引用格式

David Ferreira (2024). Naive Bayes (NB) Classifier (https://github.com/ferreirad08/NaiveBayesClassifier/releases/tag/1.1.7), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.7

See release notes for this release on GitHub: https://github.com/ferreirad08/NaiveBayesClassifier/releases/tag/1.1.7

1.1.6

See release notes for this release on GitHub: https://github.com/ferreirad08/NaiveBayesClassifier/releases/tag/1.1.6

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.3

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

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库