| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
base::UmaHistogramPercentage(histogram_name + ".Raw", result[i]);Since `result[i]` is a float (from the `ModelProvider::Response` vector), passing it directly to `UmaHistogramPercentage` (which takes an integer) relies on implicit C++ truncation. This means a value like 0.9 would be recorded as 0 rather than 1, and 79.9 would become 79.
To avoid off-by-one errors and maintain consistency with the overload above (line 461), we should probably use `base::ClampRound()` here.
500));This is a slight oddity: the bucket will not actually be 500 in prod, but will land in the overflow bucket since `UmaHistogramPercentage` only supports values `[0, 100]`.
Could you add a comment here mentioning that we intentionally ignore the `.Scaled100` histogram for this scenario? For binned classifiers returning integers > 1, we rely on the `.Raw` metric, so the overflow here is expected behavior.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
base::UmaHistogramPercentage(histogram_name + ".Raw", result[i]);Since `result[i]` is a float (from the `ModelProvider::Response` vector), passing it directly to `UmaHistogramPercentage` (which takes an integer) relies on implicit C++ truncation. This means a value like 0.9 would be recorded as 0 rather than 1, and 79.9 would become 79.
To avoid off-by-one errors and maintain consistency with the overload above (line 461), we should probably use `base::ClampRound()` here.
Sounds good, implemented!
This is a slight oddity: the bucket will not actually be 500 in prod, but will land in the overflow bucket since `UmaHistogramPercentage` only supports values `[0, 100]`.
Could you add a comment here mentioning that we intentionally ignore the `.Scaled100` histogram for this scenario? For binned classifiers returning integers > 1, we rely on the `.Raw` metric, so the overflow here is expected behavior.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PTAL, thank you. (sorry Tommy I do not know how to add a reviewer without overwriting your approval)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<owner>shakt...@chromium.org</owner>Could you add me and Sid to this owners list? Use my google.com account and Sid's chromium.org one.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PTAL (the only change was added Sid and Salg to owners)
Could you add me and Sid to this owners list? Use my google.com account and Sid's chromium.org one.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +1 |
LGTM % comment
name="SegmentationPlatform.ModelExecution.Result.{Index}.{SegmentationModel}.Scaled100"| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
base::UmaHistogramPercentage(histogram_name + ".Raw", result[i]);Alexis WuSince `result[i]` is a float (from the `ModelProvider::Response` vector), passing it directly to `UmaHistogramPercentage` (which takes an integer) relies on implicit C++ truncation. This means a value like 0.9 would be recorded as 0 rather than 1, and 79.9 would become 79.
To avoid off-by-one errors and maintain consistency with the overload above (line 461), we should probably use `base::ClampRound()` here.
Sounds good, implemented!
Sorry, why did we remove the base::ClampRound() invocation again?
base::UmaHistogramPercentage(histogram_name + ".Raw", result[i]);Alexis WuSince `result[i]` is a float (from the `ModelProvider::Response` vector), passing it directly to `UmaHistogramPercentage` (which takes an integer) relies on implicit C++ truncation. This means a value like 0.9 would be recorded as 0 rather than 1, and 79.9 would become 79.
To avoid off-by-one errors and maintain consistency with the overload above (line 461), we should probably use `base::ClampRound()` here.
Tommy NyquistSounds good, implemented!
Sorry, why did we remove the base::ClampRound() invocation again?
It's implemented in the latest patchset5.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
base::UmaHistogramPercentage(histogram_name + ".Raw", result[i]);Alexis WuSince `result[i]` is a float (from the `ModelProvider::Response` vector), passing it directly to `UmaHistogramPercentage` (which takes an integer) relies on implicit C++ truncation. This means a value like 0.9 would be recorded as 0 rather than 1, and 79.9 would become 79.
To avoid off-by-one errors and maintain consistency with the overload above (line 461), we should probably use `base::ClampRound()` here.
Tommy NyquistSounds good, implemented!
Alexis WuSorry, why did we remove the base::ClampRound() invocation again?
It's implemented in the latest patchset5.
nvm seems like I accidentally reversed it. Will do with the new add owner request :)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
base::UmaHistogramPercentage(histogram_name + ".Raw", result[i]);Alexis WuSince `result[i]` is a float (from the `ModelProvider::Response` vector), passing it directly to `UmaHistogramPercentage` (which takes an integer) relies on implicit C++ truncation. This means a value like 0.9 would be recorded as 0 rather than 1, and 79.9 would become 79.
To avoid off-by-one errors and maintain consistency with the overload above (line 461), we should probably use `base::ClampRound()` here.
Tommy NyquistSounds good, implemented!
Alexis WuSorry, why did we remove the base::ClampRound() invocation again?
Alexis WuIt's implemented in the latest patchset5.
nvm seems like I accidentally reversed it. Will do with the new add owner request :)
Done
name="SegmentationPlatform.ModelExecution.Result.{Index}.{SegmentationModel}.Scaled100"Thanks! Could you do the same for this one?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The previous patchset test failed before because we expected 0.9 to return 0 in unittest previously without using the clampround. Now it has been implemented; I corrected the expected output to 1. Should be fixed now. Thank you!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Fix data loss in Segmentation model execution metrics
Existing metrics incorrectly assumed "binned classifiers" would only return integers. This caused [0, 1] float outputs (like those in FedCM) to be rounded to 0 or 1.
This CL introduces separate histograms for raw and scaled (*100) results to ensure proper granularity for all predictor types. The original histogram is deprecated with a TODO for removal.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |