Skip to content

ENH: MNLogit strings/factor - #2048

Merged
jseabold merged 5 commits into
statsmodels:masterfrom
jseabold:mnlogit-factor
Oct 21, 2014
Merged

jseabold merged 5 commits into
statsmodels:masterfrom
jseabold:mnlogit-factor

Conversation

@jseabold

Copy link
Copy Markdown
Member

Make sure MNLogit still works with strings, factors, object arrays. This got borked in the object array check that was added. Needs to go in for 0.6. So will also need a PR versus the 0.6.x maintenance branch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general: for extra tests where we already have checked the main results, use start_params to speed up the tests.

(we need to add this also to some other tests over time to keep the total test time reasonable. So far it's mainly used in the slow tests of Kerby's GEE or Mixed)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the 'nice' tests it doesn't save much time. .04 seconds here, though I guess it all adds up.

@josef-pkt

Copy link
Copy Markdown
Member

about the unit tests: We should do this in general and start to pay more attention to speed, one start_params up or down of the fast models doesn't matter, but we have lots of unit tests, and we don't have yet a large number of unit tests for interface issues.
(Beta regression PR still does the fit for each test function.)

@jseabold

Copy link
Copy Markdown
Member Author

Agreed. It's a good idea. We should add a note about it to the testing documentation and about the setupClass classmethod.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

design issue in general (OK as short term solution)
this isn't really extensible or reusable for other models.
I think it should go into the general data handling in base, and the model should define an option that categorical endog are acceptable and should be converted.
see #2049
I don't know how this is handled in genmod GLM and GEE

@jseabold

Copy link
Copy Markdown
Member Author

Can someone reproduce these test failures? I can't. Only difference must be underlying LAPACK AFAICT. I can change the tests but would be nice to see what's going on.

@jseabold

Copy link
Copy Markdown
Member Author

For some reason it doesn't like to start where it ends up, so I'm just going to remove the start_params here.

@josef-pkt

Copy link
Copy Markdown
Member

For some reason it doesn't like to start where it ends up, so I'm just going to remove the start_params here.

This should be a separate issue, if we don't figure this out here.
I don't see any problem in the MNLogit code, but something "sounds fishy".

jseabold added a commit that referenced this pull request Oct 21, 2014
@jseabold
jseabold merged commit 2737c67 into statsmodels:master Oct 21, 2014
@jseabold
jseabold deleted the mnlogit-factor branch October 21, 2014 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants