-
Notifications
You must be signed in to change notification settings - Fork 0
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
Simplified and reconfigured model building and application #3
Simplified and reconfigured model building and application #3
Conversation
We copy them instead of modifying the existing models so that we can run them side by side for a comparison. TODO: Unify with parameters (at least for the auxiliary files) instead of making copies. This is currently unchanged so that we can have a clean diff when we do apply the changes.
Configuration changes include: - `data_preprocessing.py`: don't drop user input where any fild is None, only filter if all fields are not defined. - `evaluation_pipeline.py`: turn off filtering and cutoffs for the similarity code - `get_users.py`: don't require that 50% of the trips are labeled Then make significant changes to `build_save_model`. Concretely: - save the models after the first round, which significantly simplifies the prediction code - pull out the location map generation and user input generation code into separate functions to simplify the code invocation. Testing done: - Ran it against the staging database - Several users did not have any labeled trips ``` $ grep "enough valid trips" /tmp/staging_run.log 2021-07-27 01:31:02,224:DEBUG:Total: 0, labeled: 0, user 9cfc3133-3505-4923-b6fb-feb0e50a5aba doesn't have enough valid trips for further analysis. 2021-07-27 01:31:02,246:DEBUG:Total: 0, labeled: 0, user cc114670-ef99-4247-a3a2-47529247d8ac doesn't have enough valid trips for further analysis. 2021-07-27 01:31:02,267:DEBUG:Total: 0, labeled: 0, user 2bc8ca71-7d0f-4930-ba2c-cf97f7dceaea doesn't have enough valid trips for further analysis. 2021-07-27 01:31:05,340:DEBUG:Total: 171, labeled: 6, user 6373dfb8-cb9b-47e8-8e8f-76adcfadde20 doesn't have enough valid trips for further analysis. ``` They were filtered correctly ``` $ grep "enough valid trips" /tmp/staging_run.log | wc -l 21 ``` Models for 20 users were created ``` $ ls locations_first_round_* | wc -l 20 ``` No errors
If the user has never submitted an input, we can't infer anything. So we return early. This fixes e-mission#829 (comment)
Concretely: - pull out the matching code into `find_bin` - load only locations and user inputs - from trip -> bin -> user_labels Change filenames for consistency Added additional log statements for clarity Testing done: - Ran the intake pipeline - Ran `label_stats` for a single user - Ran the intake pipeline again - Confirmed that the confirmed trips had inferences
Previous commit: 71e299e fixes: model filenames, load process and variable name fix Testing done: really works, even with reset
- Remove it from the list of algorithms - Switch the ensemble to the one that returns the first value only
Running against the full dataset now; will deploy to staging tomorrow morning when I am not so brain dead. |
Since this is a normal use case and not an error.
After running the full intake pipeline against the staging DB from last week for one user, I get
|
The pipeline ran successfully against the staging database from last week on my laptop. |
Found at least a couple of users with:
|
Resetting the inferences; due to e-mission/e-mission-docs#654
|
Resetting the confirmed trips
Why do we have inferred trips for some and not for the others? Too late to debug now... |
Re-running the pipeline to generate confirmed trips so we can build the model.
Next, building the model
Huh! On my laptop, I got
Need to follow up on the discrepancy. Running the pipeline once so we can fill in the
Resetting the confirmed trips so they will be regenerated on the next run.
Spot checking a couple of entries
Will double check after the next pipeline run to confirm that the confirmed trips are created. @GabrielKS you can go ahead and test against staging now! |
For the same user, we now have:
|
spot checking several users, most of them don't have confirmed trips with labels. Checking the aggregate:
wha!! there's only inferred label. Maybe we fixed e-mission/e-mission-docs#654 so now we shouldn't delete the expected trips any more without resetting the pipeline. Let's regenerate everything without the hack and see if it works. |
@corinne-hcr Can you please merge this to your branch as well? It should fix the failing test.... |
Improvements from these changes, compared side by side with the old model, are at:
e-mission/e-mission-eval-private-data#28 (comment)