Skip to content

SUMM/REF: Review discrete_model #3810

Open

Description

@josef-pkt

some issues while looking at discrete models, specifically countmodels for extension in GSOC 2017

Activity

  1. jbrockmendel commented on Jul 8, 2017

    @jbrockmendel
    Contributor

    Some issues with PRs mergeable or close to it:

    Other topics in my notes:

    • ENH: DiscreteModel callback default #3706 allow user to specifically pass no-callback.

    • There are a bunch of issues regarding wrapping of MultinomialResults methods. Many of them have comments to the effect of "Not sure if this has been resolved." Possibly related: BUG: discrete.discrete_model MNLogitResults.summary2() raises ValueError in new smoketest #3651, mnlogit t_test broken, patsy? #669, BUG: f_test and t_test shape mismatch in MNLogit #457, mnlogit t_test broken, patsy? #669, BUG: fix summary2 for MNLogit #3661

    • CountModel._derivative_predict does not have test coverage for cases where a) 'ex' in transform, b) 'ey' in transform, c) count_idx is not None. Same for 'ey' in transform for _derivative_predict.

    • In CountModel.__init__, instead of delattr(self, 'offset') and delattr(self, 'exposure'), we should set those to zero or None or ... per discussion in Attribute Existence Ambiguity #3787

    • Many of the fit and fit_regularized methods could be rendered redundant if we attached attribute _results_class and _results_wrapper_class to the model classes. MultinomialModel and NegativeBinomial would still need their own fit and fit_regularized methods, but everything else could defer to DiscreteModel.

    • cov_params_func_l1 might make a good candidate for moving cov_params logic into base.cov_types.

    • Request for documentation: L2226 start_params = np.append(start_params, 0.1)
      JP: enhanced to use estimate for extra params, no code comment

    • CountModel._get_init_kwds has a comment describing it as a temporary fixup. No idea how long that has been there.
      JP: still unchanged, changing stored exposure will break backwards compatibility

    • Several comments in fit methods # TODO: make a function factory to have multiple callbacks. I'll volunteer to put that together if its still desired.

  2. jbrockmendel commented on Jul 24, 2017

    @jbrockmendel
    Contributor

    @josef-pkt pls ping me when you're back from summer break. I'm looking forward to wrapping some of these up.

  3. josef-pkt commented on Jul 24, 2017

    @josef-pkt
    MemberAuthor

    (I'm back in Canada, with jetlag and a car that didn't quite survive a wet and humid garage, which delays a bit my going back to review and merging :(
    (next priority will be on bug fixes in preparation for release and discrete_model changes coming from the new GSOC count models. I only started a partial triage in https://github.com/statsmodels/statsmodels/projects/8 )

  4. jbrockmendel commented on Jul 26, 2017

    @jbrockmendel
    Contributor

    next priority will be on bug fixes in preparation for release and discrete_model changes coming from the new GSOC count models

    Gotcha. Does that mean I should leave this be for N weeks? Or is slow-but-nonzero momentum an option?

  5. josef-pkt commented on Oct 8, 2017

    @josef-pkt
    MemberAuthor

    several of the bugs listed here have been fixed, refactorings mostly open (mostly for 0.10)

  6. josef-pkt commented on Oct 8, 2017

    @josef-pkt
    MemberAuthor

    two more details

    • MultinomialModel.fit does not use super(...).fit, instead calls base.LikelihoodModel.fit directly
    • DiscreteModel._check_perfect_pred computes fittedvalues even if not needed.
  7. josef-pkt commented on Oct 8, 2017

    @josef-pkt
    MemberAuthor

    I added a few inline comments by editing list in @jbrockmendel's comment

  8. added this to the 0.10 milestone on May 24, 2018
  9. modified the milestones: 0.10, 0.14 on Dec 16, 2021
  10. josef-pkt commented on Dec 16, 2021

    @josef-pkt
    MemberAuthor

    bump, to check what's left and we might still want to change.

    My recent PRs are enhancements to discrete, but not much refactoring and code streamlining yet.

  11. modified the milestones: 0.14, 0.15 on Dec 5, 2022
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions