Closed Jacob-Stevens-Haas closed 2 months ago
@Jacob-Stevens-Haas or @MPeng5 Have you checked the updated trapping constraints are consistent with @MPeng5 's branch? Mai, it might be worth merging your branch into this pull request and then rewriting your examples to be consistent with the new syntax here.
Oh damn, sorry, I thought I responded a while ago. TL; DR they should be consistent, but mine aren't int target/feature format - user has to flatten them to whichever format they want (there is code in the docstring for each type).
I'll check when I get back from break.
Note to self:
I wanted to share this work as a draft that adds
_make_constraints()
from example 8 totrapping_sr3.py
. All the differences are noted in the commit messages, but the big ones are:PolynomialLibrary.powers_
.n_tgts * (n_tgts + k - 1) + i + n_tgts * int(j * (2 * n_tgts - j - 3) / 2.0)
.Also a draft because I enabled too many
PolynomialLibrary
options.include_interaction=False
would be incompatible with the trapping constraints IIUC. OTOH, connecting topowers_
gives usinclude_bias=True
andinteraction_only=True
constraints for free.