Skip to content

feat: allow weights to be used for aggregation#19

Open
asiripanich wants to merge 10 commits intomainfrom
survey-weight
Open

feat: allow weights to be used for aggregation#19
asiripanich wants to merge 10 commits intomainfrom
survey-weight

Conversation

@asiripanich
Copy link
Copy Markdown
Owner

@asiripanich asiripanich commented Jun 6, 2025

The weight column in each table should have the same name.

[base]
directory = "example_data/mtc/base"
# weight = 'weight' # for aggregation using record weights

Added Total Variation Distance as a metric to compare two probability distributions.

@asiripanich asiripanich linked an issue Jun 6, 2025 that may be closed by this pull request
@AmirSamimi-TfNSW
Copy link
Copy Markdown

AmirSamimi-TfNSW commented Jun 6, 2025

Hi @asiripanich,

First of all, thank you for making this fantastic comparison tool publicly available — it's truly a must-have!

I have a suggestion that I believe could be relatively straightforward to implement, given your coding expertise, and it could save users a lot of time. Currently, users need to manually add a weight column to the final_persons, final_households, final_tours, and final_trips tables that ActivitySim generates in order to use the weighting capabilities. While it's great that the tool supports different weights per table, many users may end up simply applying a single household weight across all tables.

To streamline this, I suggest leveraging the sample_rate column that is already generated by ActivitySim in the households table. You could provide an option to automatically use sample_rate as the weight for all tables — if the column exists — and fall back to user-provided weights otherwise. This approach would eliminate the need for additional data preparation while retaining the flexibility for more advanced users to specify custom weights per table if they choose.

Happy to hear your thoughts on this!

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.

Add an option to apply weights to a scenario' outputs

3 participants