Trouble with NaiveBayes object in Statistics toolbox (R2010a)
古いコメントを表示
Hello,
I am having trouble using the NaiveBayes class and associated functions in my R2010a. Specifically, I am unable to run the NaiveBayes.fit demo on the demo dataset. When I say:
load fisheriris >> O1 = NaiveBayes.fit(meas,species);
I get ??? Error using ==> vertcat CAT arguments dimensions are not consistent.
Error in ==> NaiveBayes.fit>gaussianFit at 540 obj.Params(i,obj.GaussianFS) = mat2cell([mu;sigma],2,...
Error in ==> NaiveBayes.fit at 498 obj = gaussianFit(obj, training, gindex);
I tried t o look for an overload function for gaussianFit but did not find any.
I am however, able to run it with a 'mvmn' density model rather than a Gaussian density (default). Despite this, when I run
[post,cpre] = O1.posterior(meas);
I get all NaNs in the result. I checked that the values in O1.params are not NaNs.
What could be wrong? Any help is appreciated.
採用された回答
その他の回答 (1 件)
Tom Lane
2011 年 8 月 26 日
0 投票
I would not expect this to be a problem unless your path was set up in an unusual way. If I type "which nansum" I see the stats version. If I type "which -all nansum" I see the fints version after the stats version. If I type "type nansum" I see the contents of the stats version. What do those three commands do for you?
カテゴリ
ヘルプ センター および File Exchange で Classification Ensembles についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!