Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug in naiveBayesBayesianDemo #106

Open
mamintoosi opened this issue Jan 16, 2016 · 0 comments
Open

A bug in naiveBayesBayesianDemo #106

mamintoosi opened this issue Jan 16, 2016 · 0 comments

Comments

@mamintoosi
Copy link

Dear Kevin;
At line 38 of naiveBayesBayesianDemo.m the numbers of items in each class is computed as:
38: post.nu(c) = n;
but 'n' is not the number of items in each class, it is the total number of data, because in lines 35-37 we have:
35: ndx = Ytrain==c;
36: X = Xtrain(ndx, :);
37: n = length(ndx);
for debugging it is sufficient to change line number 35 with the following code:
ndx = find(Ytrain==c);
Yours: Mahmood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant