dls_funct.py 文件源码

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

项目:dcss_single_cell 作者: srmcc 项目源码 文件源码
def spectral(k,D, rs):
    """
    From clustering_on_transcript_compatibility_counts, see github for MIT license
    """
    if D[1,1] < 1: D = 1-D # Convert distance to similarity matrix
    spectral = cluster.SpectralClustering(n_clusters=k,affinity='precomputed', random_state=rs)
    spectral.fit(D)
    labels = spectral.labels_
    return labels

# gets max weight matching of a biparetite graph with row_label x column_label
# (weights are given by weight_matrix)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号