summary_stats.py 文件源码

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

项目:fake_news 作者: bmassman 项目源码 文件源码
def word_count_by_label(articles: pd.DataFrame):
    """Show graph of word counts by article label."""
    palette = sns.color_palette(palette='hls', n_colors=2)
    true_news_wc = articles[articles['labels'] == 0]['word_count']
    fake_news_wc = articles[articles['labels'] == 1]['word_count']
    sns.kdeplot(true_news_wc, bw=3, color=palette[0], label='True News')
    sns.kdeplot(fake_news_wc, bw=3, color=palette[1], label='Fake News')
    sns.plt.legend()
    sns.plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号