Skip to content

ENH: summary specific information for penalized #5461

Open

Description

@josef-pkt

PenalizedMixin subclasses use the inherited summary which does not contain any information about the penalization besides the model name.

When reading the summary in a notebook it would be useful to see which penalization type or class has been used and what the penalization weights are.
Maybe extra option: allow dropping some parameters from the summary table, e.g. those corresponding to large spline/polynomial basis functions or those thresholded to zero. (There is a github issue for dropping extra categorical fixed effects from the summary, IIRC.)

We should be able to add some extra information to the inherited method, i.e. without copying the super summary method, which would be model dependent.

possibilities

  • use extra attributes in top table, e.g. super summary checks for a dict, _summary_extra and appends it
  • add a 3rd (or 4th) table at bottom
  • add to extra string (which contains warnings in OLS/WLS)
  • write a separate summary_penalization method that provides an extra table or text with more info about the penalization. (e.g. we should/could also add informative __str__ and __repr__ for penalty classes which could be reused).

The problem might be similar with modifier fit_xxx methods, e.g. fit_constrained.

Activity

  1. stevenbw commented on Jan 20, 2019

    @stevenbw

    Is anyone working on this @josef-pkt? If not, I would like to take a look at this.

  2. josef-pkt commented on Jan 20, 2019

    @josef-pkt
    MemberAuthor

    Nobody is currently working on this.
    I haven't looked closely yet, whether we want a penalization specific part in summary, or some extra generic part. I don't know at the moment what extra info fit_constrained and similar would need in the summary.

    I'm still working on GAM PR #5370, but didn't plan to work on this before merging it, which should happen in the next few days.
    e.g. my latest gist https://gist.github.com/josef-pkt/2f78444b9e71294e0cd33f48fdc89a5e
    shows the formula support and the summary of the results.

    I opened this issue mainly as a user. Going back to some notebooks that I wrote a month or two ago, I am missing this information, spline basis function and penalization in the GAM case, to quickly figure out from the summary table which model was estimated.
    Thinking about the spline basis again, I think I could change the created params_names or exog_names to include the spline type code e.g. bs for bsplines, cc for cyclic regression splines.

  3. stevenbw commented on Jan 22, 2019

    @stevenbw

    I've had an initial read through some of the code. My initial thoughts are to alter the summary class to collect the penalization information from the model class and then append this to the bottom of the summary, similar to your first point in your initial comment.

  4. josef-pkt commented on Jan 22, 2019

    @josef-pkt
    MemberAuthor

    The summary class should not "know" anything about penalization, but should just process generic "extra information", that could be specified by the specific results classes, e.g. in summary before calling super(...).summary.
    The summary module could get any needed additional helper functions or methods for formatting and presenting the results.

  5. stevenbw commented on Jan 24, 2019

    @stevenbw

    Yes - the fit_regularized() or fit() method will know the extra information. The summary class can be edited to display it correctly.

  6. added 2 commits that reference this issue on Feb 3, 2019
    8130163
    cdb69e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions