Compare transition probabilities for same-category vs. different-category items.
The category-CRP bins recall transitions into same category and different category using a single feature column from a categorical embedding matrix. This is a convenience wrapper around the distance-CRP machinery, using fixed bins rather than continuous distance quantiles.
A higher same-category transition probability indicates category clustering in recall: participants preferentially transition to items sharing a category with the just-recalled item.
Workflow
Code
import osimport matplotlib.pyplot as pltimport numpy as npimport warningsfrom jaxcmr.analyses.distcrp import plot_cat_crpfrom jaxcmr.helpers import find_project_root, generate_trial_mask, load_data, save_figurewarnings.filterwarnings("ignore")
The plot shows transition probabilities for same-category and different-category items. Key patterns:
Same > Different: participants cluster recalls within categories, transitioning preferentially to items sharing a category with the just-recalled item.
Same ≈ Different: category membership does not organize recall transitions.
API Details
Notebook parameters
data_path — path to an HDF5 file containing a RecallDataset.
figure_dir — directory for saving figures.
figure_str — base filename for the saved figure. Leave empty to display without saving.
ylim — y-axis limits as a tuple, or None for automatic scaling.
trial_query — a Python expression evaluated against the dataset to select trials.
category_features_path — path to a numpy file containing category labels (shape: [word_count, n_features]).
feature_column — which column in the features array to use for categorization.
feature_label — label for the category feature in the plot legend.
confidence_level — confidence level for subject-wise error bars.