Add support for subsetting ModelSpec and ModelSpecs instances.#208
Add support for subsetting ModelSpec and ModelSpecs instances.#208matthewwardrop merged 2 commits intomainfrom
ModelSpec and ModelSpecs instances.#208Conversation
|
Very helpful. I think between this and the parser changes we are very close. The only two obvious issues are pickling, which I have a PR for in #209, and a look at variable order. |
|
@bashtage There is a bug here around materializing model matrices from the subset model matrix; in particular, an exception is raised if new columns are added due to the full-rank algorithm. I'm also massaging this a bit more, respecting the term order in the resulting model spec, and adding a few more helper methods for completeness. Should land in a day or so. |
|
Just a little positive feedback - it looks like this addition works on statsmodels when I take this branch, merge in main, and merge in my order preservation branch. |
|
Ran into 1 issue using |
|
Yeah... That's the issue I found above. Should have this one fixed pretty soon now that I know how I am going to deal with the |
9359bc0 to
a6a217c
Compare
a6a217c to
a597361
Compare
|
@bashtage This should all work nicely now in |
This implements
.subsetforModelSpecinstances, along the lines ofDesignInfo.subset. Because I like doing things over-the-top, I also implemented this forModelSpecsinstances as well, allowing one-step subsetting of nested structure.e.g.
outputs:
outputs:
@bashtage Would be great to see if this works for you.
TODO:
closes: #206