pybids icon indicating copy to clipboard operation
pybids copied to clipboard

variables: Add sparse/dense mode for to to_df, and add alternative design matrix API to access sparse variables

Open adelavega opened this issue 3 years ago • 3 comments

https://github.com/bids-standard/pybids/blob/f4bf70cccaf85dc65f2b610f448d141c014562d9/bids/variables/collections.py#L610-L620

adelavega avatar Jun 01 '22 15:06 adelavega

to_df casts everything to dense, which is a problem for the HRF property of BSM.

To be able to hand off HRF convolution to another program we need to be able to output sparse variables seperately from dense variables.

We need to add a mode that separate dense/sparse, and a different way of accessing the design matrix (aside from .X).

adelavega avatar Jun 01 '22 15:06 adelavega

@jmumford also requests this in order to look at the unconvolved regressors for model inspection

adelavega avatar Sep 26 '22 18:09 adelavega

This is actually more complex than it looks, because BIDSStatsModelsNodeOutput would need to keep in parallel both dense and sparse parts of the DM, so all logic downstream (i.e. handling intercept, expanding wild cards, etc), would have to be refactor to handle keeping the DM split.

adelavega avatar Oct 10 '22 19:10 adelavega