Skip to content

Conversation

@lucamelis
Copy link
Contributor

Summary:
This diff adds support for configurable TPR (True Positive Rate) targets in MIA.

Key Changes:

  • Added tpr_target parameter: Allows users to specify a custom TPR threshold (default behavior remains 1% if not specified)
  • Added tpr_threshold_width parameter: Controls the granularity of TPR thresholds (default: 0.25%)
  • Added input validation for tpr_threshold_width (must be positive and evenly divide 99%, e.g., 0.1%, 0.25%, 0.3%, 0.5%, etc.)
  • Added unit tests for the changes in this diff
    • test_get_tpr_index_none_target to verify legacy behavior (Returns index 0 when tpr_target=None)
    • test_get_tpr_index_with_target to verify get_tpr_index returns the correct index
    • test_tpr_threshold_width_positive_validation to verify ValueError is raised when tpr_threshold_width <= 0
    • test_tpr_threshold_width_divisibility_validation to verify ValueError is raised when tpr_threshold_width doesn't evenly divide 0.99

Backward Compatibility:

  • Fully backward compatible - existing configs without tpr_target continue to use the original 1% TPR with 100 thresholds

Differential Revision: D92439701

Summary:
This diff adds support for configurable TPR (True Positive Rate) targets in MIA.

**Key Changes:**

- Added `tpr_target` parameter: Allows users to specify a custom TPR threshold (default behavior remains 1% if not specified)
- Added `tpr_threshold_width` parameter: Controls the granularity of TPR thresholds (default: 0.25%)
- Added input validation for `tpr_threshold_width` (must be positive and evenly divide 99%, e.g., 0.1%, 0.25%, 0.3%, 0.5%, etc.)
- Added unit tests for the changes in this diff
  - `test_get_tpr_index_none_target` to verify legacy behavior (Returns index 0 when `tpr_target=None`)
  - `test_get_tpr_index_with_target` to verify `get_tpr_index` returns the correct index
  - `test_tpr_threshold_width_positive_validation` to verify ValueError is raised when `tpr_threshold_width <= 0`
  - `test_tpr_threshold_width_divisibility_validation` to verify ValueError is raised when `tpr_threshold_width` doesn't evenly divide 0.99

**Backward Compatibility:**
- Fully backward compatible - existing configs without `tpr_target` continue to use the original 1% TPR with 100 thresholds

Differential Revision: D92439701
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 9, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 9, 2026

@lucamelis has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92439701.

@meta-codesync
Copy link

meta-codesync bot commented Feb 9, 2026

This pull request has been merged in 235d105.

@lucamelis lucamelis changed the title Update target TPR of prod AIA Update target TPR of MIA Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants