plots.py 文件源码

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

项目:guacml 作者: guacml 项目源码 文件源码
def target_plot(self):
        target_type = self.input_data.metadata.loc[self.target].type
        target_data = self.input_data.df[self.target]
        sns.set(style="white", color_codes=True)
        if not self.run_time_config['is_time_series']:
            if target_type == ColType.BINARY:
                plt.figure(figsize=(6, 1))
                sns.barplot(target_data.sum() / target_data.shape[0])
                plt.xlim([0, 1])
                plt.title(target_data.name + ' rate')
            elif target_type == ColType.NUMERIC or target_type == ColType.ORDINAL:
                plt.figure(figsize=(6, 2))
                ax = sns.distplot(target_data, hist_kws=dict(edgecolor='black'))
                ax.set_xlim(target_data.min(), target_data.max())
                plt.title(target_data.name + ' histogram')
        else:
            self.time_series_target_plot()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号