def ConsensusCluster(self, data, subsamples, subsample_fraction, norm_var, kvalues):
"""
Performs consensus clustering algorithms here!!!
"""
return
partition = dict()
stuff = []
nb_clusters = 0 # this is the number of cluster the dataset is supposed to be partitioned into
distances = nx.to_numpy_matrix(data)
for i in kvalues:
clusterid, error, nfound = KMeans(distances, nclusters= i, npass=300)
uniq_ids = list(set(clusterid))
new_ids = [ uniq_ids.index(val) for val in clusterid]
for i,value in enumerate(new_ids):
partition[i] = value
stuff.append(partition)
评论列表
文章目录