While assigning the updated points to the cluster, it throws ‘dict’ has no attribute append. Although the key points is initialised as list.
PLease check the error, the notebook is at this link:
While assigning the updated points to the cluster, it throws ‘dict’ has no attribute append. Although the key points is initialised as list.
PLease check the error, the notebook is at this link:
Hey @settingsingh, in the function,
def updateClusters(clusters): #m-step(Maximisation)
for kx in range(k):
pts = np.array(clusters[kx]['points'])
if pts.shape[0]>0:
#if the cluster has non-zero points then calculate the mean and update the center as well as empty the points list
new_u = pts.mean(axis = 0)
clusters[kx]['center'] = new_u
clusters[kx]['points'] = {}
in last line it should be,
clusters[kx][‘points’] = []
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.
Hey, thanks, that small bug really bothered me for an hour!
And also thanks for baring with all my silly doubts and mistakes,really appreciate that!
Hey @settingsingh, nevermind its part of my work, and yes we all love to clear your silly doubts and mistakes.