pbharrin / machinelearninginaction

Source Code for the book: Machine Learning in Action published by Manning
manning.com/pharrington
2.37k stars 1.8k forks source link

Chapter 5, Logistic regression may have error #18

Open OnlyBelter opened 6 years ago

OnlyBelter commented 6 years ago

In your source code of Chapter 5, Line26, the weight's dimension is n + 1. But other places, like Line58 and Line67, only have n. I think you may not contain intercept term of this model.

Spico197 commented 5 years ago
weights = np.ones((3, 1))

and I get

array([[1.],
       [1.],
       [1.]])

where $weight \in \mathds{R}^{3 \times 1}$, so I guess you have a misunderstanding?