Skip to content

Bias correction#79

Open
micahwoodard wants to merge 9 commits into
mainfrom
feat-bias-correction
Open

Bias correction#79
micahwoodard wants to merge 9 commits into
mainfrom
feat-bias-correction

Conversation

@micahwoodard
Copy link
Copy Markdown
Collaborator

@micahwoodard micahwoodard commented May 3, 2026

Adds bias correction to block based trial generator. Algorithm explained in #78. I wrote it so bias overrides autowater but need to follow up w/ scis to make sure this is the desired outcome.

I'm calculating bias synchronously in the next function, but fit_logistic_regression from aind_dynamic_foraging_models may take longer than the iti period. Need to benchmark

@micahwoodard micahwoodard requested a review from bruno-f-cruz May 3, 2026 15:22
Copy link
Copy Markdown
Member

@bruno-f-cruz bruno-f-cruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the schema point of view, it looks good. I did not check the business logic, as I am not familiar with the algorithm.

Comment thread pyproject.toml Outdated
readme = {file = "README.md", content-type = "text/markdown"}

dependencies = [
"aind-dynamic-foraging-models>=0.13.1",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/AllenNeuralDynamics/aind-dynamic-foraging-models
Package made by Han, Alex, Xinxin and contains the bias calculation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be somewhat careful with bringing in that as a core dependency. If you must, go ahead, but there are quite a number of additional transitive dependencies you would be adding:

    'numpy',
    'matplotlib',
    'scikit-learn',
    'scipy',
    'pydantic',

I will leave it up to you!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah maybe it would be better to reimplement. I started and then figured I didn't want to duplicate code multiple places

micahwoodard and others added 5 commits May 3, 2026 11:23
…/block_based_trial_generator.py

Co-authored-by: Bruno Cruz <7049351+bruno-f-cruz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants