Fix shaps and comps to work with multi-card solution#360
Merged
wagnerlmichael merged 35 commits intomasterfrom May 5, 2025
Merged
Fix shaps and comps to work with multi-card solution#360wagnerlmichael merged 35 commits intomasterfrom
wagnerlmichael merged 35 commits intomasterfrom
Conversation
wagnerlmichael
commented
Mar 17, 2025
| assessment_data_ordered <- assessment_data %>% | ||
| group_by(meta_pin) %>% | ||
| arrange(desc(char_bldg_sf), meta_card_num) %>% | ||
| mutate(sqft_card_num_sort = row_number()) %>% |
Member
Author
There was a problem hiding this comment.
This column sqft_card_num_sort is persisted throughout the shaps and comps calculations to maintain the correct ordering
…erties Merge in master
…erties Merge in main
jeancochrane
approved these changes
Apr 30, 2025
Member
jeancochrane
left a comment
There was a problem hiding this comment.
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!
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>
jeancochrane
approved these changes
May 5, 2025
Member
jeancochrane
left a comment
There was a problem hiding this comment.
Awesome work! Two minor nitpicks that you can choose to accept before merging if you like, otherwise this is good to go 🥳
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
assessstage. 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_numwithin the PIN.