insight-lane / crash-model

Build a crash prediction modeling application that leverages multiple data sources to generate a set of dynamic predictions we can use to identify potential trouble spots and direct timely safety interventions.
https://insightlane.org
MIT License
112 stars 40 forks source link

Update to allow for segment-level predictions #183

Closed bpben closed 5 years ago

bpben commented 5 years ago

I'm tweaking the model script to allow for an argument in the config file that either specifies "week" or "segment". I also want to modify the initialize city script to by default predict at the segment level. @j-t-t could you take a look and tell me what you think? Am I missing anything here?

It's a bit hacky right now, I think the train_model script generally needs some streamlining. But it seems to work for Boston.

bpben commented 5 years ago

@j-t-t Just looked into it: Looks like this test is what fails: https://github.com/Data4Democracy/crash-model/blob/master/src/data/tests/test_initialize_city.py

Looks like it's a pre-built config string, which doesn't have my new "level" key. All good if I just add that in?

j-t-t commented 5 years ago

Yes, that's fine

codecov[bot] commented 5 years ago

Codecov Report

Merging #183 into master will increase coverage by 6.37%. The diff coverage is 38.33%.

@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
+ Coverage   45.45%   51.82%   +6.37%     
==========================================
  Files          29       29              
  Lines        2904     2931      +27     
==========================================
+ Hits         1320     1519     +199     
+ Misses       1584     1412     -172