kmedoids.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号