Skip to main content

SegmentAccuracyScenario

Statistics scenarios · Implementation: mlsysim/engine/scenario_definitions/statistics.py.

Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.

Accuracy measured separately on each traffic segment; traffic_shares and accuracies are keyed by segment name.

Notes

Equation: Overall accuracy sums traffic_share[k]*accuracy[k]; the worst segment minimizes the declared accuracy mapping.

Assumptions: The two mappings use matching keys and traffic shares sum to one when interpreting the weighted sum as population accuracy.

Excludes: Automatic share normalization, uncertainty intervals, and changes in segment traffic mix.

References

Derivation: Overall accuracy sums traffic_share[k]*accuracy[k]; the worst segment minimizes the declared accuracy mapping. This is declared scenario accounting rather than a fitted empirical law.

Examples

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.RecommendationAccuracyByDevice
>>> value = scenario.total_share
>>> round(float(value), 3)
1.0

Attributes

Name Description
accuracies
overall_accuracy Sum of traffic share times accuracy by matching segment key, dimensionless.
total_share Sum of declared traffic shares; this property reports rather than normalizes them.
traffic_shares
worst_segment Segment key with the smallest declared accuracy, preserving mapping tie order.

traffic_shares

Type: Dict[str, float].

Declared default: required.

accuracies

Type: Dict[str, float].

Declared default: required.

total_share

engine.scenario_types.SegmentAccuracyScenario.total_share

Sum of declared traffic shares; this property reports rather than normalizes them.

Equation: sum(traffic_shares.values()).

overall_accuracy

engine.scenario_types.SegmentAccuracyScenario.overall_accuracy

Sum of traffic share times accuracy by matching segment key, dimensionless.

Equation: sum((traffic_shares[k] * accuracies[k] for k in traffic_shares)).

worst_segment

engine.scenario_types.SegmentAccuracyScenario.worst_segment

Segment key with the smallest declared accuracy, preserving mapping tie order.

Equation: min(accuracies, key=accuracies.get).

Back to top