Robust Comparison

Robust comparison and ranking reports under hidden recomposition.

class updatesupport.comparison.ComparisonItemResult(item, rank, observed_value, lower, upper, ambiguity, public_adequate, q_name, q_description)[source]

Bases: object

One alternative’s hidden-composition interval.

Parameters:
item: Hashable
rank: int
observed_value: float
lower: float
upper: float
ambiguity: float
public_adequate: bool
q_name: str
q_description: str
as_dict()[source]
Return type:

dict[str, Any]

class updatesupport.comparison.PairwiseComparisonResult(preferred_item, compared_item, preferred_rank, compared_rank, observed_margin, lower, upper, ambiguity, margin_threshold, decision, q_name, q_description)[source]

Bases: object

One pairwise margin audit in observed-rank order.

Parameters:
preferred_item: Hashable
compared_item: Hashable
preferred_rank: int
compared_rank: int
observed_margin: float
lower: float
upper: float
ambiguity: float
margin_threshold: float
decision: DecisionResult
q_name: str
q_description: str
property robust_order: bool
property threshold_crossed: bool
as_dict()[source]
Return type:

dict[str, Any]

class updatesupport.comparison.RobustComparisonReport(title, item_column, public_columns, hidden_columns, target, target_description, observed_label, higher_is_better, margin_threshold, q_name, q_description, observed_order, observed_winner, certified_winner, status, item_results, pairwise_results)[source]

Bases: ReportArtifactMixin

Robust comparison/ranking report for several alternatives.

Parameters:
title: str
item_column: str
public_columns: tuple[str, ...]
hidden_columns: tuple[str, ...]
target: str
target_description: str
observed_label: str
higher_is_better: bool
margin_threshold: float
q_name: str
q_description: str
observed_order: tuple[Hashable, ...]
observed_winner: Hashable
certified_winner: Hashable | None
status: str
item_results: tuple[ComparisonItemResult, ...]
pairwise_results: tuple[PairwiseComparisonResult, ...]
property winner_stable: bool
property full_ranking_stable: bool
as_dict()[source]
Return type:

dict[str, Any]

to_tables()[source]

Return named tables for structured export.

Return type:

dict[str, tuple[dict[str, Any], …]]

to_markdown(*, max_pairwise_rows=20)[source]

Render an analyst-facing Markdown interpretation.

Parameters:

max_pairwise_rows (int)

Return type:

str

updatesupport.comparison.robust_comparison_report(data, *, item, public, hidden, target, weight=None, items=None, q='saturated', q_radius=None, higher_is_better=True, margin_threshold=0.0, min_cell_weight=1.0, weight_tolerance=1e-09, top=5, title='Robust Comparison Report', target_description='target value', observed_label='Observed value')[source]

Audit whether a comparison or ranking survives hidden recomposition.

Input data should be long-form: one row per alternative and hidden cell, or multiple rows that aggregate to that shape. Pairwise ranking certificates use margin targets, not independent interval overlap.

Parameters:
Return type:

RobustComparisonReport

updatesupport.comparison.robust_ranking_report(*args, **kwargs)[source]

Alias for robust_comparison_report().

Parameters:
Return type:

RobustComparisonReport