且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python SKLearn:逻辑回归概率

更新时间: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算法.