visualize.py 文件源码

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

项目:vsmlib 作者: undertherain 项目源码 文件源码
def draw_features_and_similarity(mm, words_of_interest):
    rows, cols, xlabels = mm.filter_submatrix(words_of_interest, 25)
    ax = plt.subplot(1, 2, 1)
    plot_heat(ax, cols, xlabels, words_of_interest)
    # plot_heat(ax,abs(m),numbered)
    ax = plt.subplot(1, 2, 2)
    t = 1 - pairwise_distances(rows, metric="cosine")
    np.fill_diagonal(t, 0)
    plot_heat(ax, t, words_of_interest, words_of_interest)
    # plt.savefig("m1.pdf")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号