bidsaid.events.PresentationBlockExtractor.extract_mean_accuracies
- PresentationBlockExtractor.extract_mean_accuracies(response_map, response_trial_names=None)[source]
Extract mean accuracy for each block.
Parameters
- response_map
dict[str, int]orNone, default=None A dictionary mapping response codes, from “Stim Type” column (ie. “hit”, “miss”, “other”, “false alarm”, “incorrect”), to accuracy values (0 for incorrect, 1 for correct). Use
float("NaN")to exclude a response code from the computation. Required whenresponse_typeis “correct” or “incorrect”.- response_trial_names
Iterable[str]orNone, default=None The stimulus trial names within each block to include for the accuracy computation.
Important
If
split_cue_from_blockis True, trial types are excluded from this parameter.
Returns
- list[float]
A list of mean accuracies for each block.
Note
If cue is split from the block, NaN will be assigned for its accuracy.
Example
>>> response_map = {"hit": 1, "miss": 0} >>> mean_accuracies = extractor.extract_mean_accuracies(response_map=response_map)
- response_map