-
Notifications
You must be signed in to change notification settings - Fork 17
Add mean std #467
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
Open
TimCookCountyDS
wants to merge
4
commits into
master
Choose a base branch
from
add_mean_std
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add mean std #467
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,16 +120,20 @@ gen_agg_stats <- function(data, truth, estimate, bldg_sqft, | |
| sum_fns_list <- list( | ||
| min = \(x) min(x, na.rm = TRUE), | ||
| q25 = \(x) quantile(x, na.rm = TRUE, probs = 0.25), | ||
| mean = \(x) mean(x, na.rm = TRUE), | ||
| median = \(x) median(x, na.rm = TRUE), | ||
| q75 = \(x) quantile(x, na.rm = TRUE, probs = 0.75), | ||
| max = \(x) max(x, na.rm = TRUE) | ||
| max = \(x) max(x, na.rm = TRUE), | ||
| sd = \(x) sd(x, na.rm = TRUE) | ||
| ) | ||
| sum_sqft_fns_list <- list( | ||
| min = \(x, y) min(x / y, na.rm = TRUE), | ||
| q25 = \(x, y) quantile(x / y, na.rm = TRUE, probs = 0.25), | ||
| median = \(x, y) median(x / y, na.rm = TRUE), | ||
| mean = \(x, y) mean(x / y, na.rm = TRUE), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we choose whether to have mean before or after median for consistency's sake?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved mean in sum_funs_list to after median for consistency |
||
| q75 = \(x, y) quantile(x / y, na.rm = TRUE, probs = 0.75), | ||
| max = \(x, y) max(x / y, na.rm = TRUE) | ||
| max = \(x, y) max(x / y, na.rm = TRUE), | ||
| sd = \(x, y) sd(x / y, na.rm = TRUE) | ||
| ) | ||
| yoy_fns_list <- list( | ||
| min = \(x, y) min((x - y) / y, na.rm = TRUE), | ||
|
|
||
Oops, something went wrong.
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.
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.
[Question, non-blocking] I haven't spent much time with this metrics code, so I may just be lacking context here, but can you explain why we only want to add mean/SD metrics to the
sum_fns_listandsum_sqft_fns_list, and notys_fns_listoryoy_fns_list?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.
ys_fns_listis ml specific metrics, but i don't see why we couldn't add it toyoy_fns_list.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.
Happy to add to yoy_fns_list if desired. I'd need to go back and look at those calculations, but I believe they are year over year changes expressed as percentages- in which case, I would want to be cautious about how we interpret those (depending on whether those numbers already represent an aggregate/how exactly that is calculated). I'll need to re-read the code and get back to you.
(For a little call-out on one of my cautions- see the approx. the 4th paragraph here