Skip to content

Fix shaps and comps to work with multi-card solution#360

Merged
wagnerlmichael merged 35 commits intomasterfrom
358-fix-shaps-and-comps-for-multicard-properties
May 5, 2025
Merged

Fix shaps and comps to work with multi-card solution#360
wagnerlmichael merged 35 commits intomasterfrom
358-fix-shaps-and-comps-for-multicard-properties

Conversation

@wagnerlmichael
Copy link
Member

@wagnerlmichael wagnerlmichael commented Mar 11, 2025

This PR addresses #358. We edit the interpret stage such that shaps and comps are generated to be in line with our recent multi-card methodology update. Within multi-card PINs, we essentially compute shaps and comps with a single-card, the card that was used for prediction in the assess stage. Then, we use that card's shaps and comps for each card within the multi-card PIN.

We also introduce another sorting mechanism which fixes an issue of tiebreaks within multi-card PINs. We were choosing the card to predict based on highest sqft. Sometimes the sqft was tied between two pins, which led to a tiebreak that we didn't have a rule for. Now, we give preference to the lowest meta_card_num within the PIN.

@wagnerlmichael wagnerlmichael linked an issue Mar 11, 2025 that may be closed by this pull request
assessment_data_ordered <- assessment_data %>%
group_by(meta_pin) %>%
arrange(desc(char_bldg_sf), meta_card_num) %>%
mutate(sqft_card_num_sort = row_number()) %>%
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This column sqft_card_num_sort is persisted throughout the shaps and comps calculations to maintain the correct ordering

@wagnerlmichael wagnerlmichael marked this pull request as ready for review March 17, 2025 21:46
Copy link
Member

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work! I'm glad we finally confirmed that single cards aren't affected by this change. A few suggestions below, all of them just for the sake of clarity. I'm normally not so picky, except in the model repos, where the code needs to be as clean as possible!

wagnerlmichael and others added 10 commits May 1, 2025 10:26
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Copy link
Member

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Two minor nitpicks that you can choose to accept before merging if you like, otherwise this is good to go 🥳

wagnerlmichael and others added 2 commits May 5, 2025 14:21
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
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.

Fix SHAPs and comps for multicard properties

2 participants