TICC_helper.py 文件源码

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

项目:TICC 作者: davidhallac 项目源码 文件源码
def compute_confusion_matrix(num_clusters,clustered_points_algo, sorted_indices_algo):
    """
    computes a confusion matrix and returns it
    """
    seg_len = 400
    true_confusion_matrix = np.zeros([num_clusters,num_clusters])
    for point in xrange(bt.len(clustered_points_algo)):
        cluster = clustered_points_algo[point]
        num = (int(sorted_indices_algo[point]/seg_len) %num_clusters)
        true_confusion_matrix[int(num),int(cluster)] += 1
    return true_confusion_matrix
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号