evidently.renderers
Bases:
object
Base class for all renderers
Bases:
object
id : str
info : BaseWidgetInfo
title : str
Bases:
BaseRenderer
render_html(obj)
render_json(obj)
Bases:
object
default_html_metric_renderer : Optional[MetricRenderer] = None
default_html_test_renderer : Optional[TestRenderer] = None
typed_renderers : dict
Bases:
object
description : str
details : List[DetailsInfo]
groups : Dict[str, str]
name : str
status : str
with_details(title: str, info: BaseWidgetInfo)
Bases:
BaseRenderer
html_description(obj)
json_description(obj)
render_html(obj)
render_json(obj)
Bases:
object
field_name : str
options : Optional[dict] = None
sort : Optional[SortDirection] = None
title : str
type : ColumnType = 'string'
as_dict()
Bases:
Enum
An enumeration.
HISTOGRAM = 'histogram'
LINE = 'line'
SCATTER = 'scatter'
STRING = 'string'
Bases:
object
label : str
value : str
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
Bases:
object
info : Union[BaseWidgetInfo, PlotlyGraphInfo]
title : str
Bases:
object
data : dict
layout : dict
title : str
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
Bases:
object
matrix : DataFrame
name : str
Bases:
object
name : str
x : list
y : List[Union[int, float]]
Bases:
object
details : Optional[RowDetails]
fields : dict
Bases:
object
parts : List[DetailsPartInfo]
with_part(title: str, info: Union[BaseWidgetInfo, PlotlyGraphInfo])
Bases:
Enum
An enumeration.
ASC = 'asc'
DESC = 'desc'
Bases:
object
title : str
widget : BaseWidgetInfo
Bases:
Enum
An enumeration.
FULL = 2
HALF = 1
generate widget with given counters
- Parameters
title
– widget titlecounters
– list of counters in widgetsize
– widget size
>>> display_counters = [CounterData("value1", "some value"), CounterData.float("float", 0.111, 2)]
>>> widget_info = counter(counters=display_counters, title="counters 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)
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
>>> ref_hist = HistogramData("Histogram 1", x=["a", "b", "c"], y=[1, 2, 3])
>>> curr_hist = HistogramData("Histogram 2", x=["a", "b", "c"], y=[3, 2 ,1])
>>> widget_info = histogram(
>>> title="Histogram example",
>>> primary_hist=ref_hist,
>>> secondary_hist=curr_hist,
>>> color_options=color_options
>>> )
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
>>> figure = go.Figure(go.Bar(name="Bar plot", x=[1, 2, 3, 4], y=[10, 11, 20, 11]))
>>> f_dict = figure.to_plotly_json()
>>> widget_info = plotly_data(title="Some plot title", data=f_dict["data"], layout=f_dict["layout"])
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
>>> bar_figure = go.Figure(go.Bar(name="Bar plot", x=[1, 2, 3, 4], y=[10, 11, 20, 11]))
>>> widget_info = plotly_figure(title="Bar plot widget", figure=bar_figure, size=WidgetSize.FULL)
generate plotly plot with given GraphData object.
- Parameters
graph_data
– plot data for widgetsize
– size of widget to render
>>> figure = go.Figure(go.Bar(name="Bar plot", x=[1, 2, 3, 4], y=[10, 11, 20, 11]))
>>> f_dict = figure.to_plotly_json()
>>> bar_graph_data = GraphData(title="Some plot title", data=f_dict["data"], layout=f_dict["layout"])
>>> widget_info = plotly_graph(graph_data=bar_graph_data, size=WidgetSize.FULL)
generate Tab widget with multiple graphs
- Parameters
title
– widget titlefigures
– list of graphs with tab titlessize
– widget size
>>> bar_figure = go.Figure(go.Bar(name="Bar plot", x=[1, 2, 3, 4], y=[10, 11, 20, 11]))
>>> line_figure = go.Figure(go.Line(name="Bar plot", x=[1, 2, 3, 4], y=[10, 11, 20, 11]))
>>> widget_info = plotly_graph_tabs(
... title="Tabbed widget",
... figures=[GraphData.figure("Bar", bar_figure), GraphData.figure("Line", line_figure)],
... )
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)
>>> columns_def = [
... ColumnDefinition("Column A", "field_1"),
... ColumnDefinition("Column B", "field_2", ColumnType.HISTOGRAM,
... options={"xField": "x", "yField": "y", "color": "#ed0400"}),
... ColumnDefinition("Column C", "field_3", sort=SortDirection.ASC),
... ]
>>> in_table_data = [
... RichTableDataRow(fields=dict(field_1="a", field_2=dict(x=[1, 2, 3], y=[10, 11, 3]), field_3="2")),
... RichTableDataRow(
... fields=dict(field_1="b", field_2=dict(x=[1, 2, 3], y=[10, 11, 3]), field_3="1"),
... details=RowDetails()
... .with_part("Some details", counter(counters=[CounterData("counter 1", "value")])
... )
... )
... ]
>>> widget_info = rich_table_data(title="Rich table", rows_per_page=10, columns=columns_def, data=in_table_data)
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
>>> columns = ["Column A", "Column B"]
>>> in_table_data = [[1, 2], [3, 4]]
>>> widget_info = table_data(column_names=columns, data=in_table_data, title="Table")
generate widget with tabs which can contain any other widget.
- Parameters
title
– widget titlesize
– widget sizetabs
– list of TabData with widgets to include
>>> columns = ["Column A", "Column B"]
>>> in_table_data = [[1, 2], [3, 4]]
>>> tab_data = [
... TabData("Counters", counter(counters=[CounterData("counter", "value")], title="Counter")),
... TabData("Table", table_data(column_names=columns, data=in_table_data, title="Table")),
... ]
>>> widget_info = widget_tabs(title="Tabs", tabs=tab_data)
Draw tabs widget only if there is more than one tab, otherwise just draw one widget
get_distribution_plot_figure(*, current_distribution: Distribution, reference_distribution: Optional[Distribution], color_options: ColorOptions, orientation: str = 'v')
Last modified 4mo ago