Conversation
…aggregation Adding edge cases for Boundary IoU and NSD
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting WalkthroughThe changes implement comprehensive handling of empty predictions and references across the metrics library. BinaryPairwiseMeasures now calculates a worse_dist value and returns NaN instead of numeric fallbacks in several metrics when predictions or references lack required positives/negatives. ProbabilityPairwiseMeasures tracks empty flags, while MultiLabelPairwiseMeasures integrates worse_dist reporting. ProcessEvaluation adds NaN replacement columns that conditionally substitute NaN values based on which prediction/reference was empty. Changes
Sequence DiagramsequenceDiagram
participant Metrics as BinaryPairwiseMeasures
participant MultiLabel as MultiLabelPairwiseMeasures
participant Process as ProcessEvaluation
participant Output as NaN-Replaced Columns
Metrics->>Metrics: Compute empty flags (flag_empty_pred/ref)
Metrics->>Metrics: Calculate metrics (returns NaN if empty)
Metrics->>Metrics: Compute worse_dist from ref shape
MultiLabel->>Metrics: Aggregate per-label metrics
Metrics-->>MultiLabel: Return metrics + empty flags + worse_dist
MultiLabel->>MultiLabel: Store check_empty field
Process->>MultiLabel: Retrieve resseg data
MultiLabel-->>Process: Return resseg with check_empty, worse_dist
Process->>Process: For each NaN metric in resseg
alt check_empty == 'Both'
Process->>Output: Replace NaN with BEST value
else check_empty == 'Ref' or 'Pred'
Process->>Output: Replace NaN with WORSE value
end
alt metric in LIST_DISTANCE
Process->>Output: Replace NaN with worse_dist
end
Output-->>Process: Create <measure>_nanrep columns
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Creation of relevant strategies when having to deal with NaN values in particular for the final aggregation.
Summary by CodeRabbit
New Features
Bug Fixes
Behavior Changes