test_cluster.py 文件源码

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

项目:ananke 作者: beiko-lab 项目源码 文件源码
def test_calculate_slopes_no_mask():
    mat = np.matrix([[1, 5, 7, 0, 12, 14],
                     [12, 5, 7, 18, 0, 0],
                     [6, 2, 9, 17, 0, 5]])
    tp = np.array([0, 5, 7, 11, 15, 19])
    mask = np.array(['1', '1', '1', '1', '1', '1'])
    res = calculate_slopes(mat, tp, mask)
    true_res = np.matrix([[0.8, 1, -1.75, 3, 0.5],
                          [-1.4, 1, 2.75, -4.5, 0],
                          [-0.8, 3.5, 2, -4.25, 1.25]])
    assert (res - true_res).sum() <= 10e-10

#def generate_STS_distance_matrix(slope_matrix, nthreads)
#def test_generate_STS_distance_matrix():
#    pass

#def sts_matrix_generator(ind, slope_matrix)
#def test_sts_matrix_generator():
#    pass

#def cluster_dbscan(dist_matrix, eps=1, distance_measure="sts")
#def test_cluster_dbscan():
#    pass

#def zscore(x)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号