更新时间:2022-03-03 09:24:53
coef_
和intercept_
属性表示您的想法,因为您忘记了归一化,所以概率计算已关闭:
The coef_
and intercept_
attributes represent what you think, your probability calculations are off because you forgot to normalize: after
P = A / (1 + A)
你应该做
P /= P.sum(axis=1).reshape((-1, 1))
再现 scikit-learn算法.