def _repr_html_(self):
        from mako.template import Template
        from mako.lookup import TemplateLookup

        template = Template(filename=html.SELF_TEMPLATE(__file__),
                            lookup=TemplateLookup(directories=['/']))
        return template.render(fit=self,
                               roc_plot=plot_to_html_img(self.plot_ROC),
                               cmx_plot=plot_to_html_img(
                                   self.plot_confusion_matrix))
示例#2
0
    def _repr_html_(self):
        from mako.template import Template

        path = os.path.dirname(os.path.abspath(__file__))
        file = os.path.join(path, 'html',
                            'weighted_classification_summary.html')
        template = Template(filename=file)

        # TODO add min premium field -> sum all losses / nr_of_trades
        return template.render(
            summary=self,
            gmx_plot=plot_to_html_img(self.plot_gross_confusion),
            roc_plot=plot_to_html_img(self.plot_ROC),
            cmx_plot=plot_to_html_img(self.plot_confusion_matrix),
            samples_plot=plot_to_html_img(self.plot_samples))
示例#3
0
    def _repr_html_(self):
        from mako.template import Template

        path = os.path.dirname(os.path.abspath(__file__))
        file = os.path.join(path, 'html',
                            'binary_weighted_classification_summary.html')
        template = Template(filename=file)

        return template.render(
            summary=self,
            gross_confusion=self.gross_confusion(),
            roc_plot=plot_to_html_img(self.plot_ROC),
            cmx_plot=plot_to_html_img(self.plot_confusion_matrix),
            gross_distribution_plot=plot_to_html_img(
                self.plot_gross_distribution),
        )
示例#4
0
    def _repr_html_(self):
        from mako.template import Template
        from mako.lookup import TemplateLookup

        template = Template(filename=html.SELF_TEMPLATE(__file__),
                            lookup=TemplateLookup(directories=['/']))
        return template.render(true_pred_scatter_plot=plot_to_html_img(
            self.plot_true_pred_scatter))
示例#5
0
    def _repr_html_(self):
        from mako.template import Template
        from mako.lookup import TemplateLookup

        template = Template(filename=html.FIT_TEMPLATE,
                            lookup=TemplateLookup(directories=['/']))
        return template.render(fit=self,
                               loss_plot=plot_to_html_img(
                                   self.model.plot_loss, **self._kwargs))
    def _repr_html_(self):
        from mako.template import Template
        from mako.lookup import TemplateLookup

        template = Template(filename=html.SELF_TEMPLATE(__file__),
                            lookup=TemplateLookup(directories=['/']))
        return template.render(fit=self,
                               recon_plot=plot_to_html_img(
                                   self.reconstruction_plot))
示例#7
0
    def _repr_html_(self):
        from mako.template import Template

        path = os.path.dirname(os.path.abspath(__file__))
        file = os.path.join(
            path, 'html', 'multi_binary_weighted_classification_summary.html')
        template = Template(filename=file)

        return template.render(
            summary=self,
            gross_confusions=[
                bs.gross_confusion() for bs in self.binary_summaries
            ],
            roc_plots=[
                plot_to_html_img(bs.plot_ROC) for bs in self.binary_summaries
            ],
            cmx_plots=[
                plot_to_html_img(bs.plot_confusion_matrix)
                for bs in self.binary_summaries
            ],
            # gross_loss_plot=[plot_to_html_img(bs.plot_classification) for bs in self.binary_summaries],
        )
示例#8
0
    def _repr_html_(self):
        from mako.template import Template
        from mako.lookup import TemplateLookup
        plot = "<class 'matplotlib.figure.Figure'>"

        figures = [arg(self.df, model=self.model) for arg in self.args]
        figures = [("img", plot_to_html_img(f)) if str(type(f)) == plot else
                   ("html",
                    f._repr_html_() if hasattr(f, "_repr_html_") else str(f))
                   for f in figures]

        template = Template(filename=html.SELF_TEMPLATE(__file__),
                            lookup=TemplateLookup(directories=['/']))
        return template.render(summary=self,
                               figures=figures,
                               layout=self.layout,
                               laypout_nr_columns=self.laypout_nr_columns)