Code
import osimport warningsfrom jaxcmr.analyses.conditional_corec_by_cat import plot_conditional_corec_by_catfrom jaxcmr.helpers import find_project_root, generate_trial_mask, load_data, save_figurewarnings.filterwarnings("ignore")Measure whether recalled items pull same-category neighbors into recall more than different-category neighbors.
Conditional co-recall by category measures how the probability that a neighbor was recalled depends on whether it belongs to the same or a different category as a recalled anchor item. For a given reference category, each recalled anchor from that category contributes to two bins: same-category neighbors and different-category neighbors.
A higher same-category probability relative to different-category indicates within-category clustering in recall, even after controlling for the anchor being recalled.
The plot compares co-recall probabilities for same-category and different-category neighbors of recalled anchor items. Key patterns:
dataset_name — name of the dataset (used to construct the HDF5 path as data/{dataset_name}.h5).figure_dir — directory for saving figures.figure_str — base filename for the saved figure. Leave empty to display without saving.trial_query — a Python expression evaluated against the dataset to select trials.category_field — name of the field in the dataset containing category labels.category_value — the category value defining the anchor group.relation_labels — list of two labels for the legend: [same_label, different_label].confidence_level — confidence level for subject-wise error bars.