Skip to content

API simplify BaseDatafit and BasePenalty #202

@mathurinm

Description

@mathurinm

They suffer from several issues:

  • They are intended to serve as reference code for implementation of a new penalty/datafit, but writing a new penalty is very different given the solver that you have in mind.
  • They do not inherit from abc.ABC (jitclass can't), so the @AbstractMethod is ignored
  • Block penalties inherit from it, so they have a prox_1d attribute, making solver compatibility checks hard in ENH - check datafit + penalty compatibility with solver #137 (and in reality, they don't implement it: see point above)

Suggestion: remove the solver-specific attributes from BaseDatafit and BasePenalty. Rewrite the add_penalty tutorial to make it clear that this penalty is intended for the AndersonCD solver only

One question this does not solve: how do we let a user know which attributes must a penalty implement to be compatible with a solver, and what are their signatures?

WDYT @PABannier @QB3 ?

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