facet.simulation.viz.SimulationReportStyle#

class facet.simulation.viz.SimulationReportStyle(out=None, width=80)[source]#

Renders simulation results as a text report.

Bases

TextStyle, SimulationStyle

Metaclasses

ABCMeta

Parameters
  • out (Optional[TextIO]) – the output stream this style instance writes to (defaults to sys.stdout)

  • width (int) – the maximum width available to render the text, defaults to 80

Method summary

draw_histogram

Draw the histogram of observed value counts per partition.

draw_uplift

Draw the simulation results as the mean simulated outputs with their confidence intervals.

finalize_drawing

See pytools.viz.TextStyle.finalize_drawing()

get_default_style_name

See pytools.viz.TextStyle.get_default_style_name()

get_named_styles

See pytools.viz.DrawingStyle.get_named_styles()

start_drawing

See pytools.viz.TextStyle.start_drawing()

Attribute summary

out

The output stream this style instance writes to.

width

The maximum width of the text to be produced.

Definitions

draw_histogram(partitions, frequencies, is_categorical_feature)[source]#

Draw the histogram of observed value counts per partition.

Parameters
  • partitions (Sequence[TypeVar(T_Partition)]) – the partitioning (center values) of the simulated feature

  • frequencies (Sequence[int]) – observed frequencies for each partition

  • is_categorical_feature (bool) – True if the simulated feature is categorical, False otherwise

Return type

None

draw_uplift(feature_name, output_name, output_unit, outputs_mean, outputs_lower_bound, outputs_upper_bound, baseline, confidence_level, partitions, frequencies, is_categorical_feature)[source]#

Draw the simulation results as the mean simulated outputs with their confidence intervals.

Parameters
  • feature_name (str) – name of the simulated feature

  • output_name (Union[str, Sequence[str]]) – name of the target for which output values were simulated

  • output_unit (str) – the unit of the output axis

  • outputs_mean (Sequence[float]) – the mean simulated outputs

  • outputs_lower_bound (Sequence[float]) – the lower CI bounds of the simulated outputs

  • outputs_upper_bound (Sequence[float]) – the upper CI bounds of the simulated outputs

  • baseline (float) – the baseline of the simulation

  • confidence_level (float) – the confidence level used to calculate the CI bounds

  • partitions (Sequence[Any]) – the central or categorical values representing the partitions

  • frequencies (Sequence[int]) – observed frequencies of the partitions

  • is_categorical_feature (bool) – True if the simulated feature is categorical; False otherwise

Return type

None

finalize_drawing(**kwargs)#

See pytools.viz.TextStyle.finalize_drawing()

classmethod get_default_style_name()#

See pytools.viz.TextStyle.get_default_style_name()

classmethod get_named_styles()#

See pytools.viz.DrawingStyle.get_named_styles()

start_drawing(*, title, **kwargs)#

See pytools.viz.TextStyle.start_drawing()