Skip to content

Commit 2634102

Browse files
authored
Update README.md
1 parent 75edcb3 commit 2634102

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Two scripts demonstrate the main use of the Toolbox:
2323
- Functions/: the set of functions that implement the Bayesian algorithm and summarise the Beta distribution (MAP estimate, precision etc)
2424

2525
# How do I use the toolbox with my data?
26-
1. Put your data that can be read into a DataFrame using Pandas. We use Pandas' "read_csv" function in our examples, which requires the data to be in CSV format - see any of the top-level scripts for examples.
27-
2. Use Replicate_Figure1.py as a template. Make a copy (e.g. My_Strategy_Analysis.py). Edit that copy to load your data (in the format of Step 1) and select the strategies you want to apply (in the list "strategues = ['go_left',...,]); then run it and see the results
26+
1. Put your data into a format that can be read into a DataFrame using Pandas. We use Pandas' "read_csv" function in our examples, which requires the data to be in CSV format - see any of the top-level scripts for examples.
27+
2. Use Replicate_Figure1.py as a template. Make a copy (e.g. My_Strategy_Analysis.py). Edit that copy to load your data (in the format of Step 1) and select the strategies you want to apply (in the list "strategies = ['go_left',...,]); then run it and see the results
2828
3. Write your own strategy models: see the strategymodels.py module for examples and a template. All strategy model functions have the same input (rows of the DataFrame up to the current trial) and output (the trial type as a string). Then simply add the name of the new function to your list of strategies in your script. And run it!
29+
30+
# Things to be aware of
31+
- Names and values of data variables: the supplied strategy models assume that the loaded dataset uses the following names and values for each variable: Choice ("left","right'), Reward ("yes","no"), CuePosition ("left","right").
32+
33+
- Omissions: the supplied strategy functions assume the subject made a choice on each trial. If your data contain trials with omissions (e.g. the subject did not engage on that trial) then either (a) remove those trials from the dataset before using the strategy analysis on them, or (b) edit the code to handle how you coded the omissions in your data. For example, if you coded an omission as Choice = NaN, then assign any trial with Choice = NaN as a "null" trial-type for *every* strategy; the best place to do that would be in the top-level script -- an if/else that checked first whether the trial was an omission, and then only evaluated the trial-type for each strategy if it was not an omission.

0 commit comments

Comments
 (0)