Skip to content

Conversation

Aishwarya0811
Copy link

@Aishwarya0811 Aishwarya0811 commented Aug 12, 2025

Context of the PR

Summary

Implements DoubleQuadratic datafit for asymmetric quadratic loss as requested in issue #272.

Changes

  • New DoubleQuadratic class in skglm/datafits/_double_quadratic.py
  • Support for both dense and sparse matrices
  • Integration with existing penalties and solvers
  • Comprehensive test suite
  • Updated package imports

Mathematical Details

Implements asymmetric loss function:
L(ε,α) = (1/2n) * Σᵢ weights(εᵢ) * εᵢ²
where weights(εᵢ) = 2α + 2(1-2α) * 1[εᵢ>0]

  • α < 0.5: penalizes positive residuals (overestimation) more heavily
  • α = 0.5: equivalent to standard Quadratic loss
  • α > 0.5: penalizes negative residuals (underestimation) more heavily

Testing

  • Unit tests for all methods
  • Verification that α=0.5 matches Quadratic exactly
  • Integration tests with L1 penalty and AndersonCD solver
  • Asymmetric behavior validation

Contributions of the PR

  • Adds new asymmetric loss datafit requested by the community
  • Enables modeling scenarios where overestimation and underestimation have different costs
  • Maintains full compatibility with existing skglm infrastructure
  • Provides foundation for asymmetric regression applications

Checks before merging PR

  • added documentation for any new feature
  • added unit tests
  • edited the [what's new](- |Feature| Add :class:DoubleQuadratic datafit for asymmetric loss functions)

@Aishwarya0811
Copy link
Author

Aishwarya0811 commented Aug 25, 2025

hi @tomaszkacprzak last weeks i Implements DoubleQuadratic datafit for asymmetric quadratic loss as requested in issue #272
if you had time kindly review on it i am looking forward to hear from you.😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant