subscript = len(new_cost_function) - 1 t_temp = new_cost_function[subscript] - new_cost_function[subscript - 1] diff = abs(t_temp) print 'Diff is :', diff if (diff <= 0.1): print 'center assigned for cluster1 is:', c[0] print 'center assigned for cluster2 is:', c[1] print 'center assigned for cluster3 is:', c[2] print 'center assigned for cluster4 is:', c[3] break c[:] = [] """ Finding L1 median for the four clusters and updating the centers""" min_val1, temp1 = HC.l1_Median(cluster1) c += temp1 #print 'Min now is :', min_val1 #print 'C now is :', c min_val2, temp2 = HC.l1_Median(cluster2) c += temp2 #print 'Min now is :', min_val2 #print 'C now is :', c min_val3, temp3 = HC.l1_Median(cluster3) c += temp3 #print 'Min now is :', min_val3 #print 'C now is :', c min_val4, temp4 = HC.l1_Median(cluster4)
subscript = len(new_cost_function) - 1 t_temp = new_cost_function[subscript] - new_cost_function[subscript - 1] diff = abs(t_temp) print "Diff is :", diff if diff <= 0.1: print "center assigned for cluster1 is:", c[0] print "center assigned for cluster2 is:", c[1] print "center assigned for cluster3 is:", c[2] print "center assigned for cluster4 is:", c[3] break c[:] = [] """ Finding L1 median for the four clusters and updating the centers""" min_val1, temp1 = HC.l1_Median(cluster1) c += temp1 min_val2, temp2 = HC.l1_Median(cluster2) c += temp2 min_val3, temp3 = HC.l1_Median(cluster3) c += temp3 min_val4, temp4 = HC.l1_Median(cluster4) c += temp4 min_val5, temp5 = HC.l1_Median(cluster5) c += temp5 # print 'Min now is :', min_val4