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

关于朴素贝叶斯中将概率归到[1.10001]问题 #11

Open
LeonardNiu opened this issue Apr 11, 2019 · 0 comments
Open

关于朴素贝叶斯中将概率归到[1.10001]问题 #11

LeonardNiu opened this issue Apr 11, 2019 · 0 comments

Comments

@LeonardNiu
Copy link

您好,请问在naive bayes 中train函数
`for i in range(class_num):
for j in range(feature_len):

        pix_0 = conditional_probability[i][j][0]
        pix_1 = conditional_probability[i][j][1]

      
        probalility_0 = (float(pix_0)/float(pix_0+pix_1))*1000000 + 1
        probalility_1 = (float(pix_1)/float(pix_0+pix_1))*1000000 + 1

        conditional_probability[i][j][0] = probalility_0
        conditional_probability[i][j][1] = probalility_1`

为什么要*1000000+1呢?

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