Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUMM/REF: Review discrete_model #3810

Open
josef-pkt opened this issue Jul 7, 2017 · 8 comments
Open

SUMM/REF: Review discrete_model #3810

josef-pkt opened this issue Jul 7, 2017 · 8 comments

Comments

@josef-pkt
Copy link
Member

josef-pkt commented Jul 7, 2017

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

@jbrockmendel
Copy link
Contributor

jbrockmendel commented Jul 8, 2017

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.

@jbrockmendel
Copy link
Contributor

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

@josef-pkt
Copy link
Member Author

(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 )

@jbrockmendel
Copy link
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?

@josef-pkt
Copy link
Member Author

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

@josef-pkt
Copy link
Member Author

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.

@josef-pkt
Copy link
Member Author

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

@josef-pkt josef-pkt added this to the 0.10 milestone May 24, 2018
@josef-pkt josef-pkt modified the milestones: 0.10, 0.14 Dec 16, 2021
@josef-pkt
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
0.10
Awaiting triage
Development

No branches or pull requests

2 participants