skglm
skglm copied to clipboard
Implement sample weights in `Quadratic` class
Context of the PR
To try and account for the weights for samples, I have tried to modify the Quadratic class, since it was an issue during MCPRegression where the sample had weights.
Contributions of the PR
Tried to appropriately multiply the weights wherever required.
Checks before merging PR
- [ ] added documentation for any new feature
- [ ] added unittests
- [ ] edited the what's new(if applicable)
@hoodaty can you also edit the first message of this PR to link to the related issue?
You need to add a unit test for this, again a comparison against sklearn's Lasso with sample_weights seems the easiest way in my opinion.
Quick design question:
since almost no code is shared in the altered functions, would it be worth it to add a class WeightedQuadratic inheriting from Quadratic, and overwriting only the functions we need?
closing as a duplicate of the merged #258