def avgTree(self):
data = self.ccTable
Matrix=np.zeros((self.Dimension,self.Dimension))
reducedArray=[]
for line in data:
#print line
if line is not None and len(line) is not 0:
Matrix[line[0],line[1]]= line[2]
Matrix[line[1],line[0]]= line[2]
for x in range(0,self.Dimension):
for y in range(x+1,self.Dimension):
reducedArray.append(Matrix[x,y])
Distances = np.array(reducedArray, dtype=(float))
self.Tree =hierarchy.linkage(Distances, 'average')
return self.Tree
#Funtion added to plot dendrogram in shell mode only.
#still not funtioninhg
#Uncomment when will be needed
评论列表
文章目录