Repository navigation
Add MUP-based coverage-gap diversity metric - #20
Draft
sedirmohammed wants to merge 2 commits into
Draft
sedirmohammed wants to merge 2 commits into
sedirmohammed wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Diversity data-quality dimension and a table-level diversity_coverageGap metric that computes the exact MUP-induced uncovered pattern space via finite-domain DNF union counting, with supporting GUI workflow and unit tests.
Changes:
- Add
DQDimension.DIVERSITYand register the newdiversity_coverageGapmetric in the metric registry. - Implement exact uncovered-pattern counting (
CoverageSpaceCounter) and MUP parsing/validation (including trailing per-MUP coverage validation vsmincov). - Add a dedicated Streamlit MUP uploader/editor and document the new Python + GUI workflows, plus focused unit tests.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_diversity_coverage_gap.py |
Adds unit tests for exact counting and the new diversity metric behavior. |
README.md |
Documents the new diversity_coverageGap metric and adds it to the metric list. |
metis/utils/dq_dimension.py |
Adds a new DIVERSITY DQ dimension. |
metis/metric/diversity/diversity_coverageGap.py |
Implements the metric assessment, MUP reading/parsing, and result explanation fields. |
metis/metric/diversity/diversity_coverageGap_config.py |
Adds validated config model for MUP source and positional attribute mapping. |
metis/metric/diversity/coverage_space_counter.py |
Implements exact finite-domain DNF union counting with canonicalization. |
metis/metric/diversity/__init__.py |
Exposes the diversity metric package API. |
metis/metric/__init__.py |
Registers/imports the new diversity metric so it appears in the metric registry. |
gui/ui/pages/metrics_page.py |
Uses the new dedicated MUP editor for diversity_coverageGap configuration. |
gui/ui/icons.py |
Adds an icon mapping for the new “Diversity” dimension. |
gui/ui/components/config_editors/mups_editor.py |
Implements Streamlit uploader + positional attribute mapping + mincov inference. |
docs/GUI.md |
Documents the dedicated GUI editor behavior for the new metric. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| mups_path="path/to/mups_bluenile.csv_mincov_19000.txt", | ||
| attributes=[ | ||
| "shape", "color", "cut", "clarity", | ||
| "polish", "symmetry", "florescence", |
Comment on lines
+114
to
+118
| if pd.isna(value): | ||
| return "" | ||
| if isinstance(value, float) and value.is_integer(): | ||
| return str(int(value)) | ||
| return str(value).strip() |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
diversity_coverageGapmetricmincovMotivation
METIS did not yet expose coverage-based diversity assessment from a discovered Maximal Uncovered Pattern frontier. This adds the paper-defined coverage-gap calculation while preserving METIS's existing workflow and higher-is-better score convention. The exact coverage gap remains available in the result explanation, while
DQvaluestores its complement, the coverage-space score.User impact
Users can upload a dataset and its corresponding MUP file in the Streamlit GUI, select the discovery attributes, and calculate the exact coverage gap. Python users can configure the same metric with a MUP file path.
For the supplied Blue Nile case at
mincov=19000, the implementation reproduces:The 40 trailing MUP coverage values are parsed and validated; they range from 75 to 17,488.
Validation
.venv/bin/python -m compileall -q metis guigit diff --check