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
[coalesce] Use mean of grouped edge weights rather than minimum #127
Conversation
Excellent observation - thank you!! This also helps in working towards addressing various risks associated with this issue: #126 |
TODO:
|
@kuanb i updated the logic and reran, the impact is much less unfortunately. but it is a start. |
peartree/toolkit.py
Outdated
if not G.has_edge(rn1, rn2): | ||
# Append new edge with attributes to list | ||
length = avg_length | ||
# Note: the mode is determined by the first edge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kuanb what's your thought on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think coalesce is sort of a mess with transit... Let's figure it out for walk first... I think assume a comment like you did is good. Maybe add a todo. In future we should segment coalesce by mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks will circle back tomorrow morning
peartree/toolkit.py
Outdated
|
||
# Second step; which uses results from edge_df grouping/parsing | ||
edges_to_add = [] | ||
# Go through each edge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Extraneous comment, would remove
peartree/toolkit.py
Outdated
if not G.has_edge(rn1, rn2): | ||
# Append new edge with attributes to list | ||
length = avg_length | ||
# Note: the mode is determined by the first edge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think coalesce is sort of a mess with transit... Let's figure it out for walk first... I think assume a comment like you did is good. Maybe add a todo. In future we should segment coalesce by mode
@yiyange Update on this PR: I just updated tests, tweaked logic. Should be passing the Travis tests shortly and will merge in after that - thanks again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated tests, modified and cleaned up logic that was being adjusted. Added some TODO flags for a deeper dive in the future.
Codecov Report
@@ Coverage Diff @@
## master #127 +/- ##
==========================================
+ Coverage 91.43% 91.68% +0.24%
==========================================
Files 13 13
Lines 1109 1106 -3
==========================================
Hits 1014 1014
+ Misses 95 92 -3
Continue to review full report at Codecov.
|
Using minimum of grouped edge weights effectively reduce path costs, and increase accessibility significantly.
The following map shows shortest path lengths from one single source to all destinations in Berkeley.
It changes from using original full network to coalesced network using min grouped edge weights. Noticing the shortest path lengths reduce significantly (darker color to lighter color)
The following map shows the same change but using coalesced network using mean (different color bins though). The change is less significant.
Also some stats comparison:
Visuals made by UrbanFootprint :))