Skip to content

BUG - attribute alpha is not available for penalty=SLOPE() for string representation #315

@jolars

Description

@jolars

Describe the bug

I am getting test errors from skglm (https://github.com/benchopt/benchmark_slope/actions/runs/15496605501/job/43634699241#step:7:471):

self       = <[AttributeError("'SLOPE' object has no attribute 'alpha'") raised in repr()] GeneralizedLinearEstimator object at 0x13454a440>

The problem, I think, is that on the following line you expect alpha to exist:

self.penalty.alpha))

But for SLOPE it is alphas:

self.alphas = alphas

Steps to reproduce

from skglm import GeneralizedLinearEstimator, SLOPE

from skglm.penalties import SLOPE

alphas = [0.1, 0.5, 1.0, 2.0, 5.0]

model = GeneralizedLinearEstimator(penalty = SLOPE(alphas))

repr(model)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions