I've worked on #36, simplifying the constraint a bit. I've basically done the following:
Placing the non-zero terms in the right place now happens in the abstract baseclass. The operation mapping the coeffs (0.5, 1.3) with mask (0, 1, 1, 0) -> (0, 0.5, 1.3, 0) is now done in the baseclass. This makes implementing a constraint simpler, because previously necessary op now happens automatically. It also means the output is consistent (theta (n x m) in, coefficient (m x 1) out.) and that your specific constraint is independent of the underlying mask and baseclass, making it much easier to (unit-) test.
Added a method mapp_coeffs to the abstract baseclass. See point above; for clarity I implemented this in a separate function.
Renamed calculate_coeffs to fit, to bring it in line with the estimator class.
Forward now returns coefficients. Forward should always return something, even if we don't use it.
I've tested it using the least squares and gradient constraint, both work. Am submitting a PR for ridge regression shortly.
Hi all,
I've worked on #36, simplifying the constraint a bit. I've basically done the following:
Placing the non-zero terms in the right place now happens in the abstract baseclass. The operation mapping the coeffs (0.5, 1.3) with mask (0, 1, 1, 0) -> (0, 0.5, 1.3, 0) is now done in the baseclass. This makes implementing a constraint simpler, because previously necessary op now happens automatically. It also means the output is consistent (theta (n x m) in, coefficient (m x 1) out.) and that your specific constraint is independent of the underlying mask and baseclass, making it much easier to (unit-) test.
Added a method mapp_coeffs to the abstract baseclass. See point above; for clarity I implemented this in a separate function.
Renamed calculate_coeffs to fit, to bring it in line with the estimator class.
Forward now returns coefficients. Forward should always return something, even if we don't use it.
I've tested it using the least squares and gradient constraint, both work. Am submitting a PR for ridge regression shortly.