FalseAlarmBudgetScenario
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.
One detection window every window, listening_per_day of each day, over horizon.
budget is the expected false alarms allowed per horizon. Each window with no keyword is a chance to fire, so a per-window rejection rate multiplies into a count; rejection_levels lists rates to compare against the budget.
Notes
Equation: expected alarms = listening windows * false-positive probability; allowable probability = budget / windows.
Assumptions: Listening windows tile the active listening duration. The calculation controls expected counts, not a probability of no alarms.
Excludes: Temporal dependence in alarm episodes, deduplication, and uncertainty in the supplied rejection rate.
References
Derivation: expected alarms = listening windows * false- positive probability; allowable probability = budget / windows. The individual properties state units and intermediate accounting; this class introduces no fitted coefficient.
Examples
The named scenario supplies illustrative inputs; the output is calculated.
>>> from mlsysim import Scenarios
>>> case = Scenarios.KeywordSpotterFalseWakes
>>> round(float(case.listening_time.to('h').magnitude), 3)
720.0Attributes
| Name | Description |
|---|---|
| budget | |
| horizon | |
| listening_per_day | |
| listening_time | Total active listening hours over the declared horizon, scaling the daily |
| rejection_levels | |
| rejection_needed | Per-window true-negative fraction needed to meet the false-alarm budget. |
| target_false_positive_rate | False-positive probability per window that exhausts the expected-count budget. |
| window | |
| windows | Number of detection-window opportunities over active listening time; fractional |
Methods
| Name | Description |
|---|---|
| false_alarms | Expected count over the horizon from windows times one minus the supplied |
| false_alarms_at_rate | Expected count over active listening time at a supplied inverse-time false-alarm |
false_alarms
engine.scenario_types.FalseAlarmBudgetScenario.false_alarms(rejection)Expected count over the horizon from windows times one minus the supplied rejection fraction.
Equation: return windows * (1 - rejection).
false_alarms_at_rate
engine.scenario_types.FalseAlarmBudgetScenario.false_alarms_at_rate(rate)Expected count over active listening time at a supplied inverse-time false-alarm rate.
Equation: return (rate * listening_time).to('').magnitude.
window
Type: Quantity.
Declared default: required.
listening_per_day
Type: Quantity.
Declared default: required.
horizon
Type: Quantity.
Declared default: required.
budget
Type: float.
Declared default: required.
rejection_levels
Type: List[float].
Declared default: [].
listening_time
engine.scenario_types.FalseAlarmBudgetScenario.listening_time
Total active listening hours over the declared horizon, scaling the daily listening schedule.
Equation: return (horizon.to('day').magnitude * listening_per_day).to('hour').
windows
engine.scenario_types.FalseAlarmBudgetScenario.windows
Number of detection-window opportunities over active listening time; fractional counts are retained.
Equation: return (listening_time / window).to('').magnitude.
target_false_positive_rate
engine.scenario_types.FalseAlarmBudgetScenario.target_false_positive_rate
False-positive probability per window that exhausts the expected-count budget.
Equation: return budget / windows.
rejection_needed
engine.scenario_types.FalseAlarmBudgetScenario.rejection_needed
Per-window true-negative fraction needed to meet the false-alarm budget.
Equation: return 1 - target_false_positive_rate.