Problem with the naive bayes classifier from the stats toolbox.
4 次查看(过去 30 天)
显示 更早的评论
I have a problem using the Naive Bayes classifier from the statistiques toolbox. I'm having the following error :
??? Error using ==> NaiveBayes.fit>gaussianFit at 528 For Gaussian distribution, each class must have at least two non-missing values.
Error in ==> NaiveBayes.fit at 498 obj = gaussianFit(obj, training, gindex);
Error in ==> nBayes at 53 O = NaiveBayes.fit(Xl,Cl,'dist','normal','Prior','empirical'); % build the model
Xl and Cl have the right dimensions, so I don't see from where the problem comes.
0 个评论
回答(1 个)
the cyclist
2013-2-25
Well, the error message is telling you that one of your classes does not have at least two non-missing values.
I suggest you type
>> dbstop if error
before running your code. Then, when you run your code, it will stop execution when it hits the error. You can then look at the values of your variables to get a hint at the problem.
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!