-
Notifications
You must be signed in to change notification settings - Fork 13
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.1.dev24] Integrating changes from models in production #79
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smmaurer
changed the title
Work in progress: Integrating changes from models in production
[0.1.dev22] Work in progress: Integrating changes from models in production
Dec 17, 2018
smmaurer
changed the title
[0.1.dev22] Work in progress: Integrating changes from models in production
[0.1.dev24] Work in progress: Integrating changes from models in production
Dec 18, 2018
smmaurer
changed the title
[0.1.dev24] Work in progress: Integrating changes from models in production
[0.1.dev24] Integrating changes from models in production
Dec 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements clean, systematic versions of changes from the
ej-test
branch that's being used for various models in production. Issue #75 discusses that branch in more depth.Also implements some ancillary improvements: adds a change log, moves the tests, etc.
1. Fixes a string comparison bug
Code like
string is 'value'
mostly works for string comparison, but not always. If the strings contain the same characters but were created in different ways, it can fail. Maybe encoding plays a role too? This caused a bug in the binary logit template where anout_value_false
setting of'nothing'
was not being read correctly from YAML in Windows. Usingstring == 'value'
fixes this.This is fixed in binary logit and in a couple of other places where a similar comparison was being used for ModelManager's saving/reloading of PyLogit pickle files.
2. Adds model object as an attribute of large MNL model steps
It's available as
m.model
any time after model stepm
is fitted, including after it's reloaded from storage. This provides achoicemodels.MultinomialLogitResults
object, which you can use for things like getting diagnostic choice probabilities outside of the usual simulation flow.3. Improves the documentation of large MNL class attributes
These are now documented in a single place. Also tweaked the attribute availability a bit to make it more consistent. (MergedChoiceTable now available after a model is run, unless the choices have capacity constraints.)
4. Enables on-the-fly creation of output columns
Adds general functionality for this as
utils.update_column()
, but for now only large MNL uses it. Other templates are left as-is pending a bigger update.5. Fixes a simulation bug when there are no valid choosers
If large MNL finds no valid choosers or no valid alternatives after applying filters, the model step will now print a message and exit.
6. Adds more unit tests
Adds or improves unit tests for all of the above.
7. Adds a change log
CHANGELOG.md
.8. Moves tests out of the module directory
Moves tests to the root directory, which is more standard and seems to fix some problems with the new PyTest 4.0.
Versioning