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_mapdict[str, int] or None, 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 when response_type is “correct” or “incorrect”.

response_trial_namesIterable[str] or None, default=None

The stimulus trial names within each block to include for the accuracy computation.

Important

If split_cue_from_block is 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)