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

[0.2.dev8] Fully enable "backdoor" MergedChoiceTable functionality for Segmented Large MNL #118

Merged
merged 9 commits into from
Apr 17, 2020

Conversation

mxndrwgrdnr
Copy link
Member

As the title states, these changes are meant to enable the user to pass in their own MergedChoiceTable object to use for estimating a segmented large-n multinomial logit in choicemodels. The primary use case is for including interaction terms in a model specification (e.g. individual chooser-alternative distances in a location choice model).

The most questionable change I've made is probably in how the LargeMultinomialLogit model handles an mct object passed in to its fit() method. What I've had to do here is to convert the mct to a dataframe, apply the chooser filters to that df, and then re-cast to an mct object per the new functionality in the PR here. This was the simplest solution I could come up with to the problem of segment-based filtering on a user-constructed MergedChoiceTable object. The alternative would have been to do that filtering in the segmented MNL class. Happy to go that route if you prefer.

Let me know what you think.

In any event, we'll want to merge the PR in choicemodels before merging this one.

@mxndrwgrdnr
Copy link
Member Author

FWIW, here is an example of how I'm estimating a segmented large MNL with interaction terms: https://github.com/ual/bayarea_urbansim/blob/py3/notebooks/hlcm_owner_estimate.ipynb

@coveralls
Copy link

coveralls commented Apr 13, 2020

Coverage Status

Coverage decreased (-0.4%) to 91.78% when pulling 2767215 on segment_mct into 1d15d38 on master.

@smmaurer
Copy link
Member

@mxndrwgrdnr This all looks good to me. If you increment the version number, i think it's good to merge! I just pushed some commits that fix Travis.

@mxndrwgrdnr mxndrwgrdnr merged commit 03d377e into master Apr 17, 2020
@mxndrwgrdnr mxndrwgrdnr deleted the segment_mct branch April 17, 2020 21:53
@smmaurer smmaurer changed the title Fully enable "backdoor" MergedChoiceTable functionality for Segmented Large MNL [0.2.dev8] Fully enable "backdoor" MergedChoiceTable functionality for Segmented Large MNL May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants