Activity: Shopping List#
Documentation for tasks.shopping_list.py, part of the Tasks utilities in the M2C2 DataKit package.
Module Summary#
This module contains functions to score and summarize the Shopping List task data. The Shopping List task is a delayed recognition task where participants are asked to determine whether shopping list item-price combinations presented during a retrieval phase match the combinations judged during a price judgment phase of the task. The Shopping List task assesses Episodic Memory and Associative Long-term Memory by requiring participants to remember and recall item prices from a virtual shopping list.

Citations#
[INSERT CITATIONS HERE]
Public API#
shopping_list
#
Shopping List Task Functions
This module contains functions to score and summarize the Shopping List task data.
Functions:
| Name | Description |
|---|---|
score_accuracy |
Retrieves the accuracy of the response for a single trial in the Shopping List task. |
summarize |
Summarizes the scored Shopping List task data by calculating various statistics for each phase of the task. |
score_accuracy(row)
#
Retrieves the accuracy of the response for a single trial in the Shopping List task.
In practice, this is the same value as the current row of the response_correct column in the trial-level shopping list task dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
Series
|
A single row of the trial-level shopping list task dataframe. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The value of the |
Raises:
| Type | Description |
|---|---|
Exception
|
If an error occurs while processing the row. |
Source code in m2c2_datakit/tasks/shopping_list.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
summarize(x, trials_expected=20, rt_outlier_low=100, rt_outlier_high=10000)
#
Summarizes the Shopping List task data by calculating various statistics for each phase of the task.
This function calculates the number of trials, median response times, and accuracy for both the judgement and retrieval phases of the Shopping List task. It filters out invalid response times (e.g., -999) and outliers based on the provided lower and upper bounds. The results are returned as a Pandas Series with keys corresponding to the calculated statistics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataFrame
|
The trial-level scored dataset for the Shopping List task. |
required |
trials_expected
|
int
|
The expected number of trials for the Shopping List task. Defaults to 20. |
20
|
rt_outlier_low
|
int
|
The lower bound for filtering outliers in response times. Defaults to 100. |
100
|
rt_outlier_high
|
int
|
The upper bound for filtering outliers in response times. Defaults to 10000. |
10000
|
Returns:
| Type | Description |
|---|---|
Series
|
A Pandas Series containing the summary statistics for each phase of the Shopping List task. |
Source code in m2c2_datakit/tasks/shopping_list.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |