237 240 per instance results#247
Conversation
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
There was a problem hiding this comment.
Pull request overview
This PR implements per-instance metric persistence/output in the aggregator TSV to support downstream distribution/meta-analysis (issues #237 and #240), while adding safeguards in statistics/plotting to avoid double-counting when instance rows are present.
Changes:
- Add optional TSV output of per-instance rows alongside the existing per-sample “master” row.
- Extend
PanopticaResult.to_dict()to optionally return[master_dict, inst_0_dict, …]for aggregator consumption. - Add statistics helpers/flags intended to exclude instance rows from summaries/figures by default.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
panoptica/panoptica_statistics.py |
Adds subject filtering helpers and “master-only” filtering for summaries/figures to avoid double counting with instance rows. |
panoptica/panoptica_result.py |
Switches several metric IDs to be derived from Metric.*.result_id and adds optional per-instance dict export from list-metrics. |
panoptica/panoptica_aggregator.py |
Adds output_individual_instance_metrics flag and writes additional _inst_ rows to TSV when enabled. |
panoptica/metrics/metrics.py |
Introduces a result_id helper for metrics to standardize result key naming (sq_*). |
panoptica/instance_evaluator.py |
Minor cleanup: remove redundant tp local and clarify return type comment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
…/panoptica into 237-240-per-instance-results
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
…/panoptica into 237-240-per-instance-results
|
What do you think about the export format? TODO: The Statistics package needs to be updated as well. |
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/format |
|
🤖 I will now format your code with black. Check the status here. |
| raise NotImplementedError( | ||
| "PanopticaAUTCResult does not support per-instance output; " | ||
| "set output_individual_instance_metrics=False on the aggregator when using is_autc=True." | ||
| ) |
There was a problem hiding this comment.
We omit instance wise reporting for AUTC for now to keep complexity of tsv managable:
Combining them gives a roughly thresholds × instances blow-up of cells per subject, plus the question of which cells are meaningful (unmatched refs at a given threshold) vs. empty.
This PR implements 237 240 respectively.
Global and averaged metrics are defined in the sample row.
Instance rows only define their instance metrics
The truncated example output looks like following: