data-science-from-scratch icon indicating copy to clipboard operation
data-science-from-scratch copied to clipboard

Code in Chapter 20 Clustering has redundant line #57

Open danli349 opened this issue 2 years ago • 2 comments

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

danli349 avatar Dec 14 '22 14:12 danli349

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

KianYang-Lee avatar Jan 09 '23 09:01 KianYang-Lee

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

danli349 avatar Jan 09 '23 13:01 danli349