Repository navigation
Conversation
|
As part of this PR, I'd like to add support for selection of a reference category for MNLogit and mention the reference in the summary. Should be easy to do. #837 Needs to be added to release notes as well. |
b379cc1 to
778a7a4
Compare
|
@jseabold |
| class MultinomialModel(BinaryModel): | ||
|
|
||
| def _handle_data(self, endog, exog, missing, hasconst, **kwargs): | ||
| reference = kwargs.pop('reference', 0) |
There was a problem hiding this comment.
Can we just add reference=0 to the signature? Pushing back against the **kwargs pattern.
| ynames = ["{0}={1}".format(yname, ynames[i]) for i in keys] | ||
| elif data_tools._is_using_pandas(endog, None): | ||
| # patsy goes through here | ||
| endog_dummies, ynames, yname = _pandas_to_dummies(endog) |
There was a problem hiding this comment.
Not necessarily in this PR, but for pd.Categoricals a corner case to watch out for is when there are unused categories.
| def bic(self): | ||
| return -2*self.llf + np.log(self.nobs)*(self.df_model+1) | ||
|
|
||
| def _get_endog_name(self, yname, yname_list): |
There was a problem hiding this comment.
+1 for making this not-a-method
| return obj | ||
|
|
||
| def attach_columns(self, result): | ||
| return getattr(self, method_name)(obj, *names) |
There was a problem hiding this comment.
-1. There's too much getattr and setattr as it is.
| def attach_columns(self, result): | ||
| return getattr(self, method_name)(obj, *names) | ||
|
|
||
| def attach_columns(self, result, *arg, **kwargs): |
There was a problem hiding this comment.
Are there existing cases when **kwargs get passed?
| ----- | ||
| See developer notes for further information on `MNLogit` internals. | ||
| """ % {'extra_params' : base._missing_param_doc} | ||
| """ % {'extra_params' : _mnlogit_extra_params} |
There was a problem hiding this comment.
If this is only used in one place, does why not just put it here?
|
This pull request introduces 2 alerts and fixes 1 when merging 778a7a4 into f4cf57c - view on lgtm.com new alerts:
fixed alerts:
Comment posted by lgtm.com |
Closes #2147.