pdstools.decision_analyzer.plots._components¶
Component / filter analysis plots.
Attributes¶
Functions¶
|
|
|
Horizontal bar chart showing which items each component filters most. |
|
Bar chart drilling into a single component's filtered actions with |
|
Violin + ECDF + summary statistics for a single prioritization component. |
|
Small-multiples violin panel showing all components side by side. |
Module Contents¶
- _ECDF_MAX_ROWS = 50000¶
- filtering_components(self, stages: list[str], top_n, AvailableNBADStages, additional_filters: polars.Expr | list[polars.Expr] | None = None, return_df=False)¶
- component_action_impact(self, top_n: int = 10, scope: str = 'Action', additional_filters: polars.Expr | list[polars.Expr] | None = None, return_df=False)¶
Horizontal bar chart showing which items each component filters most.
One facet per component (top components by total filtering), bars show items sorted by filtered decision count. The scope controls whether the breakdown is at Issue, Group, or Action level.
- Parameters:
top_n (int, default 10) – Maximum number of items per component.
scope (str, default "Action") – Granularity:
"Issue","Group", or"Action".additional_filters (pl.Expr or list of pl.Expr, optional) – Extra filters applied before aggregation.
return_df (bool, default False) – If True, return the DataFrame instead of a figure.
- Return type:
go.Figure or pl.DataFrame
- component_drilldown(self, component_name: str, scope: str = 'Action', additional_filters: polars.Expr | list[polars.Expr] | None = None, sort_by: str = 'Filtered Decisions', return_df=False)¶
Bar chart drilling into a single component’s filtered actions with value context.
Shows filtered actions sorted by the chosen metric, with secondary axis for average scoring values when available.
- Parameters:
component_name (str) – The pxComponentName to drill into.
scope (str, default "Action") – The granularity level to display (Issue, Group, or Action).
additional_filters (pl.Expr or list of pl.Expr, optional) – Extra filters applied before aggregation.
sort_by (str, default "Filtered Decisions") – Column to sort by. Also accepts “avg_Value”, “avg_Priority”.
return_df (bool, default False) – If True, return the DataFrame instead of a figure.
- Return type:
go.Figure or pl.DataFrame
- plot_priority_component_distribution(value_data: polars.LazyFrame, component: str, granularity: str, color_discrete_map: dict[str, str] | None = None)¶
Violin + ECDF + summary statistics for a single prioritization component.
- plot_component_overview(value_data: polars.LazyFrame, components: list[str], granularity: str) plotly.graph_objects.Figure¶
Small-multiples violin panel showing all components side by side.
Each component gets its own subplot with a fully independent x-axis so their different scales are always visible.