Skip to content

[ENH] StatsModels: Add invalid_inputs parameter to allow dropping of missing data columns to run nodes #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

coryshain
Copy link

BIDSStatsModelsNode.run() gracefully drops missing contrasts when invalid_contrasts=="drop", but missing data columns in the GLM at the run level (entries of Model.X) currently always throw an error. As far as I can tell, this makes it impossible to use BIDSStatsModelsNode (and BIDS apps that depend on it, like fitlins) for tasks in which some conditions do not appear in some runs (a use case I happen to have at the moment, which also seems to pop up for others, e.g., here and here). This PR adds an invalid_inputs parameter BIDSStatsModelsNode.run() and BIDSStatsModelsNodeOutput.__init__() that permits a "drop" value just like invalid_contrasts, which warns about missing data columns and then removes them from var_names. I've tested this modification with fitlins and it appears to give the desired enhancement: individual runs estimate all and only the available contrasts (and missing contrasts at downstream nodes are then handled by the existing invalid_contrasts feature). I've set the default value of invalid_inputs to "error", so that the previous default behavior remains unchanged.

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.

1 participant