Reiver Operating Characteristic¶
- class ReceiverOperatingCharacteristic(receiving_radar, transmitting_device, receiving_device, radar_channel, num_thresholds=101)[source]¶
Bases:
RadarEvaluator
,Serializable
Evaluate the receiver operating characteristics for a radar operator.
The receiver operating characteristics (ROC) curve is a graphical plot that illustrates the performance of a detector by visualizing the probability of false alarm versus the probability of detection for a given parameterization.
A minimal example within the context of a
Simulation
evaluating the probability of detection for a single radar target illuminated by anFMCW
radar would be:1from hermespy.radar import Radar, FMCW, ReceiverOperatingCharacteristic 2from hermespy.simulation import Simulation 3from hermespy.channel import SingleTargetRadarChannel 4 5# Create a new simulated scenario featuring a single device 6simulation = Simulation() 7device = simulation.new_device(carrier_frequency=60e9) 8 9# Configure the device to transmit and reveive radar waveforms 10radar = Radar(waveform=FMCW()) 11device.add_dsp(radar) 12 13# Create a new radar channel with a single illuminated target 14target = SingleTargetRadarChannel(1, 1., attenuate=True) 15simulation.scenario.set_channel(device, device, target) 16 17# Create a new detection probability evaluator 18simulation.add_evaluator(ReceiverOperatingCharacteristic(radar, device, device, target)) 19 20# Run the simulation 21result = simulation.run()
- Parameters:
radar (Radar) – Radar under test.
radar_channel (RadarChannelBase) – Radar channel containing a desired target.
num_thresholds (int, optional) – Number of different thresholds to be considered in ROC curve
- static FromScenario(scenario, operator, h0_campaign='h0', h1_campaign='h1', console=None)[source]¶
- Return type:
- static FromScenarios(h0_scenario, h1_scenario, h0_operator=None, h1_operator=None, num_thresholds=101)[source]¶
Compute an ROC evaluation result from two scenarios.
- Parameters:
h0_scenario (Scenario) – Scenario of the null hypothesis.
h1_scenario (Scenario) – Scenario of the alternative hypothesis.
h0_operator (Radar, optional) – Radar operator of the null hypothesis. If not provided, the first radar operator of the null hypothesis scenario will be used.
h1_operator (Radar, optional) – Radar operator of the alternative hypothesis. If not provided, the first radar operator of the alternative hypothesis scenario will be used.
num_thresholds (int, optional) – Number of different thresholds to be considered in ROC curve
- Return type:
Returns: The ROC evaluation result.
- Raises:
If the scenarios are not in replay mode - If the scenarios have no recorded drops available - If the operators are not registered within the scenarios - If, for any reason, the operated devices cannot be determined
- classmethod From_HDF(file, h0_campaign='h0_measurements', h1_campaign='h1_measurements', num_thresholds=101)[source]¶
Compute an ROC evaluation result from a savefile.
- Parameters:
file (Union[str, File]) – Savefile containing the measurements. Either as file system location or h5py File handle.
h0_campaign (str, optional) – Campaign identifier of the h0 hypothesis measurements. By default, h0_measurements is assumed.
h1_campaign (str, optional) – Campaign identifier of the h1 hypothesis measurements. By default, h1_measurements is assumed.
num_thresholds (int, optional) – Number of different thresholds to be considered in ROC curve
- Return type:
Returns: The ROC evaluation result.
- static GenerateResult(grid, artifacts, num_thresholds=101, evaluator=None)[source]¶
Generate a new receiver operating characteristics evaluation result.
- Parameters:
grid (Sequence[GridDimension]) – Grid dimensions of the evaluation result.
artifacts (numpy.ndarray) – Artifacts of the evaluation result.
num_thresholds (int, optional) – Number of different thresholds to be considered in ROC curve 101 by default.
evaluator (ReceiverOperatingCharacteristic, optional) – Evaluator that generated the evaluation result.
- Return type:
Returns: The generated result.
- evaluate()[source]¶
Evaluate the state of an investigated object.
Implements the process of extracting an arbitrary performance indicator, represented by the returned
Artifact
\(X_m\).Returns: Artifact \(X_m\) resulting from the evaluation.
- Return type:
- generate_result(grid, artifacts)[source]¶
Generate a new receiver operating characteristics evaluation result.
- Parameters:
grid (Sequence[GridDimension]) – Grid dimensions of the evaluation result.
artifacts (numpy.ndarray) – Artifacts of the evaluation result.
- Return type:
Returns: The generated result.
- class RocEvaluation(cube_h0, cube_h1)[source]¶
Bases:
Evaluation
[PlotVisualization
]Evaluation of receiver operating characteristics (ROC)
- Parameters:
- class RocArtifact(h0_value, h1_value)[source]¶
Bases:
Artifact
Artifact of receiver operating characteristics (ROC) evaluation
- Parameters:
- class RocEvaluationResult(detection_probabilities, false_alarm_probabilities, grid, evaluator=None)[source]¶
Bases:
EvaluationResult
Final result of an receive operating characteristcs evaluation.
- Parameters:
detection_probabilities (numpy.ndarray) – Detection probabilities for each grid point.
false_alarm_probabilities (numpy.ndarray) – False alarm probabilities for each grid point.
grid (Sequence[GridDimension]) – Grid dimensions of the evaluation result.
evaluator (ReceiverOperatingCharacteristic, optional) – Evaluator that generated the evaluation result.