reporter.py 文件源码

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

项目:postlearn 作者: TomAugspurger 项目源码 文件源码
def plot_grid_scores(self, x, hue=None, row=None, col=None, col_wrap=None,
                         **kwargs):
        def none_if_none(x):
            return None if x == 'None' else x

        if has_widgets:
            choices = ['None'] + list(unpack_grid_scores(self.model)
                                      .columns.drop(['mean_', 'std_']))

            @interact(x=choices, hue=choices, row=choices, col=choices)
            def wrapper(x=x, hue=None, row=None, col=None):
                return plot_grid_scores(self.model,
                                        none_if_none(x),
                                        'mean_',
                                        hue=none_if_none(hue),
                                        row=none_if_none(row),
                                        col=none_if_none(col),
                                        col_wrap=none_if_none(col_wrap),
                                        **kwargs)
            return wrapper
        else:
            return plot_grid_scores(self.model, x, 'mean_', hue=hue, row=row,
                                    col=col, col_wrap=col_wrap, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号