Repository navigation
Feature/brainexplorer - #101
Merged
Merged
Conversation
…and remove KernelUpdate
… and improve codebook descriptions in SpaceObserver and Scavenger classes, and several bug fixes
Recode Scavenger choices, fix time of day, and accept DataFrames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
cpm.brainexplorer, which computes descriptive statistics and applies the exclusion criteria for four BrainExplorer games, with tests and an API reference page. It also fixes how the optimisers handleppt_identifier, and bumps the version to 0.26.0.dev1.Changes
cpm.brainexplorer(new). One class per game, each withmetrics(),clean_data()andget_codebook():perceptual_decision_making.SpaceObserverrisky_decision_making.Scavengerinformation_gathering.TreasureHuntbandits.MilkyWayEach class reads a CSV file or a DataFrame, and raises a
KeyErrorthat names any required column missing from the data.Bugs fixed in the module before it lands:
Scavengerassumedchosenwas coded 0 (safe) / 1 (risky), but raw exports use 1 / 2, so the "risky" metrics measured safe choices. Choices are now recoded on load, and any other coding raises an error.Scavenger: an operator-precedence bug (~t_loss & rsk == 0) maderational_safe_win,rational_safe_loss,rational_risky_winandrational_risky_lossuse the wrong trials.Scavenger.clean_data()now applies the documented exclusion for repeating the same left/right response on at least 95% of trials.TreasureHuntandMilkyWaynever classified a session as "night".MilkyWaynever wrote the session date and time to its results. Itsclean_data()failed unlessdifference_metrics()had been run first.TreasureHunt.codebook()andMilkyWay.codebook()could not be called; they are nowget_codebook(), as in the other classes.metrics()twice appended duplicate rows.Optimisers.
Fmin,FminBound,Bads,Minimize,DifferentialEvolutionandEstimatorMetaDraisedUnboundLocalErrorfor a DataFrame withoutppt_identifier. They now:ValueErrorsaying what to pass,KeyErrorlisting the columns ifppt_identifieris not one of them,ppt_identifierfrom the grouping when the data are grouped by one column (data.groupby("ppt")), so the fits record the participants.Generators. Restores
main's handling of values outside a prior's support inParameters.PDF. An old commit on this branch gave them a log prior of about 0, the value for probability 1, instead of the lowest finite value.Datasets. Adds
cpm.datasets.load_model_based_model_free, two-step task data from BrainExplorer, with a page in the API reference.Merge with
main. Conflicts were resolved in favour ofmain. In particular, the branch'sMBMFmodel is replaced bymain'sHybridMBMF.Testing
test/brainexplorer/. TheScavengertests use hand-computed values for a participant designed so that the old coding bug gives different answers.-W.🤖 Generated with Claude Code