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))
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))
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), )
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))
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))
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], )
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)