MATLAB Answers

Lester Lim

What sort of support elements does naive bayes classifier need?

Asked by Lester Lim
on 25 Jan 2013

What sort of support elements does naive bayes classifier need? I've got to insert two of this and not sure what sort of elements tit needs...Please help!!!



No products are associated with this question.

1 Answer

Answer by Tom Lane
on 25 Jan 2013
 Accepted answer

If you are referring to and its 'KSSupport' argument, then you can omit this in most cases. You would specify it as [0,1], for example, if you wanted to force the density to be zero outside that range.

If you are referring to something else, please provide more details.


Tom Lane
on 28 Jan 2013

I can show you two valid examples, then an example with an invalid specification of support:

>> x = rand(100,1);
>> ksdensity(x)
>> ksdensity(x,'support',[0 1])
>> ksdensity(x,'support',4)
Error using ksdensity>compute_finite_support (line 193)
Value of 'support' parameter must have two elements.

However, it appears from other postings that you may be trying to use ksdensity from within NaiveBayes, and there is some question about what release or releases you are using. I can't tell from that information what is going wrong.

Lester Lim
on 29 Jan 2013

Does the support refer to the statistical toolbox's support?

Tom Lane
on 29 Jan 2013

It refers to the support of the probability distribution. Search for "support" on this page:

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!