Trouble with NaiveBayes object in Statistics toolbox (R2010a)
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Tom Lane
am 26 Aug. 2011
0 Stimmen
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?
1 Kommentar
Pavan
am 29 Aug. 2011
Kategorien
Mehr zu Classification Ensembles finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!