Skip to content

[Bug]: Coefficient Shape Mismatch in MultiPenaltyLasso #75

Open
@Fontanapink

Description

@Fontanapink

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions