i get Undefined variable "NaiveBayes" or class "NaiveBayes.fit".
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi,
Hoping someone can help.
I'm using MATLAB2018b version and am attempting to use a Naive Bayes classifer on a dataset. However I get the following error when I run this line of code:-
(i've already loaded variables XtrA and YtrA)
nb = NaiveBayes.fit(XtrA, YtrA);
error:
Undefined variable "NaiveBayes" or class "NaiveBayes.fit".
nb = NaiveBayes.fit(XtrA, YtrA);
I've confirmed that I have the Statistics and Machine Learning toolbox installed by typing ver at command line:
Statistics and Machine Learning Toolbox Version 11.4 (R2018b)
Many thanks
Angela
댓글 수: 0
채택된 답변
Subhadeep Koley
2019년 8월 6일
Hi, I understand that you are trying to use NaiveBayes.fit in MATLAB R2018b.
According to the R2014b Release Notes NaiveBayes.fit is replaced with fitNaiveBayes and also According to the R2018a Release Notes fitNaiveBayes is replaced with fitcnb.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Naive Bayes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!