Hi , Could you please explain what you are trying to do in this part of the code.
for clust in range (0, num_clusters):
alpha = clust_to_items_1[clust, :]
alpha_beta = beta.multiply(alpha)
sum_row = alpha_beta.sum(1)[0, 0]
num_nonzero = alpha_beta.nonzero()[1].__len__() + 0.001
to_impute = sum_row/num_nonzero
Z = np.repeat(to_impute, beta.shape[1])
alpha_z = alpha.multiply(Z)
idx = beta.nonzero()
alpha_z[idx] = beta.data
It seems alpha_z was supposed to collection of beta.data instead getting reassigned at every iteration.
Hi , Could you please explain what you are trying to do in this part of the code.
It seems alpha_z was supposed to collection of beta.data instead getting reassigned at every iteration.