Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Coefficient Shape Mismatch in MultiPenaltyLasso #75

Open
1 of 6 tasks
Fontanapink opened this issue Sep 23, 2024 · 0 comments
Open
1 of 6 tasks

[Bug]: Coefficient Shape Mismatch in MultiPenaltyLasso #75

Fontanapink opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Fontanapink
Copy link
Member

Bug Title

This bug may be an error/oversight but it might not be

Describe the Bug

There seems to be a shape mismatch issue with the coefficients in the MultiPenaltyLasso class. When fitting the model with non-zero penalties, the coefficients are returned in a shape (features x targets), but it is expected to be (targets x features). This mismatch could lead to confusion or errors when using the model and interpreting the results.

Steps to Reproduce

  1. Use the MultiPenaltyLasso class and fit it with mock data where some alpha values are zero.
  2. Observe the shape of the coef_ attribute after fitting the model.
  3. Compare the expected shape (targets x features) vs the actual shape (features x targets).

Expected Behavior

The coefficient matrix should ideally be returned in a shape of (targets x features), especially to align with common conventions in sklearn-like models.

Actual Behavior

The coefficient matrix is returned in a shape of (features x targets), which leads to a mismatch in the tests and may cause confusion when interpreting the model's output.

Environment

OS: Windows 10 Python version: 3.11.7 Dependencies: sklearn, numpy

Additional Context

This issue was discovered during testing when asserting the shape of the coef_ attribute. The tests expect (targets x features), but the model returns (features x targets).
There may need to be either a fix in the code to transpose the coefficients, or clear documentation explaining the output format.

Optional Labels

  • HIGH priority
  • LOW priority
  • good first issue
  • help wanted
  • wontfix
  • question/discussion
@Fontanapink Fontanapink added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant