skglm icon indicating copy to clipboard operation
skglm copied to clipboard

Implement sample weights in `Quadratic` class

Open hoodaty opened this issue 1 year ago • 2 comments

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 avatar Apr 10 '24 12:04 hoodaty

@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.

mathurinm avatar Apr 11 '24 11:04 mathurinm

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?

QB3 avatar Apr 12 '24 14:04 QB3

closing as a duplicate of the merged #258

mathurinm avatar Jun 24 '24 14:06 mathurinm