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

逻辑回归demo中的bug以及可能的解决方案 #255

Open
qwerfdg opened this issue Mar 21, 2022 · 0 comments
Open

逻辑回归demo中的bug以及可能的解决方案 #255

qwerfdg opened this issue Mar 21, 2022 · 0 comments

Comments

@qwerfdg
Copy link
Contributor

qwerfdg commented Mar 21, 2022


逻辑回归模型的预测输出结果是1维的,在得到预测分类的时候却使用了argmax函数寻找多个维度中的最大值,这里输出的结果只能是0,这里存在bug。以sigmod二分类为例,我认为这里预测输出的结果应该是属于0-1之间的一个概率,大于0.5时结果分类为标签1,小于0.5时结果分类为标签0,应该改成如下这样:
if i > 0.5: f.write(str(1) + '\n') else : f.write(str(0) + '\n')

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