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

04 机器学习 贝叶斯代码实现没有P(Y=C) #2

Open
CS231 opened this issue Jan 3, 2022 · 0 comments
Open

04 机器学习 贝叶斯代码实现没有P(Y=C) #2

CS231 opened this issue Jan 3, 2022 · 0 comments

Comments

@CS231
Copy link

CS231 commented Jan 3, 2022

04 机器学习 贝叶斯代码实现没有P(Y=C)
probabilities = {}
for label, value in self.model.items():
probabilities[label] = 1
for i in range(len(value)):
mean, stdev = value[i]
probabilities[label] *= self.gaussian_probability(
input_data[i], mean, stdev)
return probabilities

没有实现P(Y=C)

公式中不是要计算p(y)p(x|y)吗?
是不是少乘一个p(y)

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