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

Code in Chapter 20 Clustering has redundant line #57 #116

Open
danli349 opened this issue Dec 14, 2022 · 2 comments
Open

Code in Chapter 20 Clustering has redundant line #57 #116

danli349 opened this issue Dec 14, 2022 · 2 comments

Comments

@danli349
Copy link

danli349 commented Dec 14, 2022

Hello,

The code in Chapter 20 Clustering has redundant line 57
https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/clustering.py

self.means = cluster_means(self.k, inputs, assignments)

This line is repeated with line 47 and can be deleted.
Thanks

@KianYang-Lee
Copy link

@danli349 If you look closely, it's not repeated, as assignments is reassigned in line 56.

@danli349
Copy link
Author

danli349 commented Jan 9, 2023

@KianYang-Lee I know the assignments changed, but this line is not necessary and can be deleted without changing anything.

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