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

Typoe Ch4 - Page 136 #90

Open
mzakariaCERN opened this issue Dec 16, 2018 · 1 comment
Open

Typoe Ch4 - Page 136 #90

mzakariaCERN opened this issue Dec 16, 2018 · 1 comment
Labels
fixed-in-3rd-edition Tagged as fixed in the upcoming 3rd edition

Comments

@mzakariaCERN
Copy link

mzakariaCERN commented Dec 16, 2018

indices = np.argsort(importances[::-1]) # this causes the wrong order for plt.show() at the end of the code chunk (though the values are correct)
indices = importances.argsort()[::-1] # gives correct order

in the remote chance that this was a legit issue, It would be a privilege to be mentioned!

@rasbt
Copy link
Owner

rasbt commented Jun 14, 2019

Thanks for the note! In my version, it's not

indices = np.argsort(importances[::-1])

but

indices = np.argsort(importances)[::-1]

which would be similar to what you suggested with indices = importances.argsort()[::-1]

When I remember correctly, Packt had briefly an unedited version online in ~2017 that contained that issue, but it should be fixed now.

Screen Shot 2019-06-14 at 6 20 04 AM

@rasbt rasbt added the fixed-in-3rd-edition Tagged as fixed in the upcoming 3rd edition label Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-3rd-edition Tagged as fixed in the upcoming 3rd edition
Projects
None yet
Development

No branches or pull requests

2 participants