python-machine-learning-book-3rd-edition icon indicating copy to clipboard operation
python-machine-learning-book-3rd-edition copied to clipboard

Errata in Ch2~Ch9

Open rickiepark opened this issue 4 years ago • 4 comments

  • p39: 4th eq. in the note In $ \sum_i (w_i^{{i}} x_i^{(i)} $, subscript i should be changed other character because it means sample index and remove superscript of w like: $ \sum_k (w_k x_k^{(i)} $
  • p59: 4th line in first code block c='' raises an error in matplotlib 3.2, suggest replace facecolor='none'
  • p61: 8th line L05_gradient-descent_slides.pdf shoud be changed L08_logistic_slides.pdf
  • p63: 5th line from the bottom $ \phi(x) = 0.5 $ should be changed $ \phi(0) = 0.5 $
  • p94: first line, 9th line $ 0.1 \overline{\overline{6}} $ should be changed $ 0.1 \overline{6} $ $ 0. \overline{\overline{16}} $ should be changed $ 0.1 \overline{6} $
  • p100: 10th line As you know, scikit-learn now can do post-pruning with ccp_alpha
  • p107: In first eq. $ x_k^{(i)} x_k^{(j)} $ should be changed $ x_k^{(i)} - x_k^{(j)} $
  • p119: 16th line and 7th line from the bottom (X[:, 0].reshape(-1, 1))) should be changed (X[:, 0].reshape(-1, 1)) In c_transf.fit_transform(X).astype(float), astype(float) is not needed.
  • p162: In 2nd code block It's better that mean_overall = mean_overall.reshape(d, 1) is moved above for loop.
  • p173: note box $ \sum v = \lambda v $, so $ v = \frac{1}{n} \sum_{i=1}^n a^{(i)} \phi(x^{(i)}) = \lambda \phi(X)^T a $ should be changed $ v = \sum_{i=1}^n a^{(i)} \phi(x^{(i)}) = \phi(X)^T a $
  • p172: last eq. and $ \frac{1}{n} \sum_{i=1}^n a^{(i)} \phi(x^{(i)}) $ should be changed $ \sum_{i=1}^n a^{(i)} \phi(x^{(i)}) $
  • p228: 10th line from the bottom and last line $ C_j (J \in {0, 1}) $ should be changed $ C_j (J \in {1, 2, 3}) $ $ 0.2 \times i_0 + 0.2 \times i_0 + 0.6 \times i_1 $ should be changed $ 0.2 \times i_0 + 0.2 \times i_0, 0.6 \times i_1 $
  • p266: 8th line "previous equations" should refer to idf(t, d) not tf idf(t, d)
  • p273: 14th line smooth_idf parameter does not exist in second dictionary.
  • p294: 3rd line under Form validation and rendering section wtforms.readthedocs.org/en/latest should be changed wtforms.readthedocs.io
  • p296: the line above Adding style via CSS section jinja.pocoo.org should be changed jinja.palletsprojects.com
  • p299: last line flask.pocoo.org/docs/1.0/ shoud be changed flask.palletsprojects.com

Thanks. :)

rickiepark avatar Jan 25 '21 05:01 rickiepark

Thanks a lot! Will incorporate it into the next ed!

Btw regarding

p59: 4th line in first code block c='' raises an error in matplotlib 3.2, suggest replace facecolor='none'

I think they mean c="none", I think the facecolor warning is a separate warning related to the 'x' marker.

rasbt avatar May 26 '21 03:05 rasbt

In c_transf.fit_transform(X).astype(float), astype(float) is not needed.

Inuitively, I agree with you. But removing it will results in a NumPy array of dtype=object. Might be a scikit-learn bug. Screen Shot 2021-06-17 at 1 53 01 PM

rasbt avatar Jun 17 '21 18:06 rasbt

Ah.. you're right. ColumnTransformer.fit_transform() returns an array of dtype=object. An array of dtype=object is converted float64 in sklearn.utils.validation.check_array() but using astype(float) is more clear. I'm not sure this is scikit-learn bug. Thanks :)

rickiepark avatar Jun 18 '21 04:06 rickiepark

I see, thanks for the feedback!

rasbt avatar Jun 18 '21 15:06 rasbt