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!