evidently.renderers
Submodules
base_renderer module
class BaseRenderer(color_options: Optional[ColorOptions] = None)
Bases: object
Base class for all renderers
Attributes:
color_options : ColorOptions
class DetailsInfo(title: str, info: evidently.model.widget.BaseWidgetInfo, id: str = )
Bases: object
Attributes:
id : str
info : BaseWidgetInfo
title : str
class MetricRenderer(color_options: Optional[ColorOptions] = None)
Bases: BaseRenderer
Attributes:
color_options : ColorOptions
Methods:
render_html(obj)
render_json(obj)
class RenderersDefinitions(typed_renderers: dict = , default_html_test_renderer: Optional[evidently.renderers.base_renderer.TestRenderer] = None, default_html_metric_renderer: Optional[evidently.renderers.base_renderer.MetricRenderer] = None)
Bases: object
Attributes:
default_html_metric_renderer : Optional[MetricRenderer] = None
default_html_test_renderer : Optional[TestRenderer] = None
typed_renderers : dict
class TestHtmlInfo(name: str, description: str, status: str, details: List[DetailsInfo], groups: Dict[str, str])
Bases: object
Attributes:
description : str
details : List[DetailsInfo]
groups : Dict[str, str]
name : str
status : str
Methods:
with_details(title: str, info: BaseWidgetInfo)
class TestRenderer(color_options: Optional[ColorOptions] = None)
Bases: BaseRenderer
Attributes:
color_options : ColorOptions
Methods:
html_description(obj)
json_description(obj)
render_html(obj)
render_json(obj)
default_renderer(wrap_type)
html_widgets module
class ColumnDefinition(title: str, field_name: str, type: evidently.renderers.html_widgets.ColumnType = <ColumnType.STRING: 'string'>, sort: Optional[evidently.renderers.html_widgets.SortDirection] = None, options: Optional[dict] = None)
Bases: object
Attributes:
field_name : str
options : Optional[dict] = None
sort : Optional[SortDirection] = None
title : str
type : ColumnType = 'string'
Methods:
as_dict()
class ColumnType(value)
Bases: Enum
An enumeration.
Attributes:
HISTOGRAM = 'histogram'
LINE = 'line'
SCATTER = 'scatter'
STRING = 'string'
class CounterData(label: str, value: str)
Bases: object
Attributes:
label : str
value : str
Methods:
static float(label: str, value: float, precision: int)
create CounterData for float value with given precision.
Parameters
label
– counter labelvalue
– float value of counterprecision
– decimal precision
static int(label: str, value: int)
create CounterData for int value.
Parameters
label
– counter labelvalue
– int value
static string(label: str, value: str)
create CounterData for string value with given precision.
Parameters
label
– counter labelvalue
– string value of counter
class DetailsPartInfo(title: str, info: Union[BaseWidgetInfo, PlotlyGraphInfo])
Bases: object
Attributes:
info : Union[BaseWidgetInfo, PlotlyGraphInfo]
title : str
class GraphData(title: str, data: dict, layout: dict)
Bases: object
Attributes:
data : dict
layout : dict
title : str
Methods:
static figure(title: str, figure: Figure)
create GraphData from plotly figure itself :param title: title of graph :param figure: plotly figure for getting data from
class HeatmapData(name: str, matrix: pandas.core.frame.DataFrame)
Bases: object
Attributes:
matrix : DataFrame
name : str
class HistogramData(name: str, x: list, y: List[Union[int, float]])
Bases: object
Attributes:
name : str
x : list
y : List[Union[int, float]]
class RichTableDataRow(fields: dict, details: Optional[RowDetails] = None)
Bases: object
Attributes:
details : Optional[RowDetails]
fields : dict
class RowDetails(parts: Optional[List[DetailsPartInfo]] = None)
Bases: object
Attributes:
parts : List[DetailsPartInfo]
Methods:
with_part(title: str, info: Union[BaseWidgetInfo, PlotlyGraphInfo])
class SortDirection(value)
Bases: Enum
An enumeration.
Attributes:
ASC = 'asc'
DESC = 'desc'
class TabData(title: str, widget: evidently.model.widget.BaseWidgetInfo)
Bases: object
Attributes:
title : str
widget : BaseWidgetInfo
class WidgetSize(value)
Bases: Enum
An enumeration.
Attributes:
FULL = 2
HALF = 1
counter(*, counters: List[CounterData], title: str = '', size: WidgetSize = WidgetSize.FULL)
generate widget with given counters
Parameters
title
– widget titlecounters
– list of counters in widgetsize
– widget size
Example
get_class_separation_plot_data(current_plot: DataFrame, reference_plot: Optional[DataFrame], target_name: str, color_options: ColorOptions)
get_heatmaps_widget(*, title: str = '', primary_data: HeatmapData, secondary_data: Optional[HeatmapData] = None, size: WidgetSize = WidgetSize.FULL, color_options: ColorOptions)
Create a widget with heatmap(s)
get_histogram_figure(*, primary_hist: HistogramData, secondary_hist: Optional[HistogramData] = None, color_options: ColorOptions, orientation: str = 'v')
get_histogram_figure_with_quantile(*, current: HistogramData, reference: Optional[HistogramData] = None, current_quantile: float, reference_quantile: Optional[float] = None, color_options: ColorOptions, orientation: str = 'v')
get_histogram_figure_with_range(*, primary_hist: HistogramData, secondary_hist: Optional[HistogramData] = None, left: Union[float, int], right: Union[float, int], orientation: str = 'v', color_options: ColorOptions)
get_histogram_for_distribution(*, current_distribution: Distribution, reference_distribution: Optional[Distribution] = None, title: str = '', xaxis_title: Optional[str] = None, yaxis_title: Optional[str] = None, color_options: ColorOptions)
get_pr_rec_plot_data(current_pr_curve: dict, reference_pr_curve: Optional[dict], color_options: ColorOptions)
get_roc_auc_tab_data(curr_roc_curve: dict, ref_roc_curve: Optional[dict], color_options: ColorOptions)
header_text(*, label: str, title: str = '', size: WidgetSize = WidgetSize.FULL)
generate widget with some text as header
Parameters
label
– text to displaytitle
– widget titlesize
– widget size
histogram(*, title: str, primary_hist: HistogramData, secondary_hist: Optional[HistogramData] = None, color_options: ColorOptions, orientation: str = 'v', size: WidgetSize = WidgetSize.FULL, xaxis_title: Optional[str] = None, yaxis_title: Optional[str] = None)
generate widget with one or two histogram
Parameters
title
– widget titleprimary_hist
– first histogram to show in widgetsecondary_hist
– optional second histogram to show in widgetorientation
– bars orientation in histogramscolor_options
– color options to use for widgetssize
– widget sizexaxis_title
– title for x-axisyaxis_title
– title for y-axis
Example
plotly_data(*, title: str, data: dict, layout: dict, size: WidgetSize = WidgetSize.FULL)
generate plotly plot with given data and layout (can be generated from plotly).
Parameters
title
– widget titledata
– plotly figure datalayout
– plotly figure layoutsize
– widget size
Example
plotly_figure(*, title: str, figure: Figure, size: WidgetSize = WidgetSize.FULL)
generate plotly plot based on given plotly figure object.
Parameters
title
– title of widgetfigure
– plotly figure which should be rendered as widgetsize
– size of widget, default to WidgetSize.FULL
Example
plotly_graph(*, graph_data: GraphData, size: WidgetSize = WidgetSize.FULL)
generate plotly plot with given GraphData object.
Parameters
graph_data
– plot data for widgetsize
– size of widget to render
Example
plotly_graph_tabs(*, title: str, figures: List[GraphData], size: WidgetSize = WidgetSize.FULL)
generate Tab widget with multiple graphs
Parameters
title
– widget titlefigures
– list of graphs with tab titlessize
– widget size
Example
rich_table_data(*, title: str = '', size: WidgetSize = WidgetSize.FULL, rows_per_page: int = 10, columns: List[ColumnDefinition], data: List[RichTableDataRow])
generate widget with rich table: with additional column types and details for rows
Parameters
title
– widget titlesize
– widget sizerows_per_page
– maximum number per page to showcolumns
– list of columns in tabledata
– list of dicts with data (key-value pairs, keys is according to ColumnDefinition.field_name)
Example
table_data(*, column_names: Iterable[str], data: Iterable[Iterable], title: str = '', size: WidgetSize = WidgetSize.FULL)
generate simple table with given columns and data
Parameters
column_names
– list of column names in display orderdata
– list of data rows (lists of object to show in table in order of columns), object will be converted to strtitle
– widget titlesize
– widget size
Example
widget_tabs(*, title: str = '', size: WidgetSize = WidgetSize.FULL, tabs: List[TabData])
generate widget with tabs which can contain any other widget.
Parameters
title
– widget titlesize
– widget sizetabs
– list of TabData with widgets to include
Example
widget_tabs_for_more_than_one(*, title: str = '', size: WidgetSize = WidgetSize.FULL, tabs: List[TabData])
Draw tabs widget only if there is more than one tab, otherwise just draw one widget
notebook_utils module
determine_template(mode: str)
render_utils module
get_distribution_plot_figure(*, current_distribution: Distribution, reference_distribution: Optional[Distribution], color_options: ColorOptions, orientation: str = 'v')
plot_distr(*, hist_curr, hist_ref=None, orientation='v', color_options: ColorOptions)
Last updated