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

Errata in Ch2~Ch9 #145

Open
rickiepark opened this issue Jan 25, 2021 · 4 comments
Open

Errata in Ch2~Ch9 #145

rickiepark opened this issue Jan 25, 2021 · 4 comments

Comments

@rickiepark
Copy link

  • 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. :)

@rasbt
Copy link
Owner

rasbt commented May 26, 2021

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
Copy link
Owner

rasbt commented Jun 17, 2021

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

@rickiepark
Copy link
Author

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 :)

@rasbt
Copy link
Owner

rasbt commented Jun 18, 2021

I see, thanks for the feedback!

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

2 participants