Release Ethnicolr 2.0 - #141
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58a81fa2e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uncertainty_method="mc-dropout" if uncertainty_level is not None else None, | ||
| uncertainty_level=uncertainty_level, |
There was a problem hiding this comment.
Record conformal requests in uncertainty metadata
When conformal_coverage is supplied, validation requires uncertainty_level=None, so these assignments always leave both metadata fields missing even though the result contains a conformal prediction set. Consumers relying on the inference contract therefore cannot determine that the set is split-conformal or whether its requested coverage was 0.80, 0.90, or 0.95; populate uncertainty_method and uncertainty_level from conformal_coverage in this branch.
Useful? React with 👍 / 👎.
|
|
||
| category_probabilities[~script_supported] = np.nan | ||
| evidence_basis[~script_supported] = "none" | ||
| scored_rows = script_supported & np.isfinite(category_probabilities).any(axis=1) |
There was a problem hiding this comment.
Do not mark partial Census distributions as scored
For an out-of-dictionary surname handled by the four-category neural fallback, aian and 2prace remain NaN, but this any(axis=1) check marks the row as scored. That contradicts the new contract's promise that every target probability on a scored row is finite and forms a complete distribution, and downstream code filtering on scored will receive incomplete six-category results. Either represent the unavailable categories consistently or avoid declaring such rows complete.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
3354e4e to
85b83ec
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85b83ecb19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| surname_not_in_dictionary = ~surname_in_dictionary | ||
| neural_model_result = None | ||
| if surname_not_in_dictionary.any(): |
There was a problem hiding this comment.
Skip neural fallback for rows that must abstain
When an out-of-dictionary row has a missing, non-letter, or unsupported-script name, this condition still invokes estimate_census_surname; because neural weights are now downloaded on demand, an otherwise dictionary-based call such as a frame containing only null names can perform an unnecessary network request and fail offline instead of returning the promised abstention result. Restrict the fallback mask to script-supported rows and leave the other rows unscored.
Useful? React with 👍 / 👎.
| covered = ( | ||
| adaptive_prediction_scores(category_probabilities, observed_categories) | ||
| <= conformal_quantile | ||
| ) |
There was a problem hiding this comment.
Measure coverage using the generated prediction sets
When the true class is the first class whose cumulative probability crosses the conformal quantile, build_conformal_prediction_sets includes it via the extra + 1, but this predicate reports it as uncovered because its cumulative score is greater than the quantile. Consequently the empirical coverage values written into every calibration statistics artifact measure a different, smaller set than inference actually returns, corrupting the reported validation results; compute membership using the same set-size rule used at inference.
Useful? React with 👍 / 👎.
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* Prepare Ethnicolr 2.0 release * Fix release-blocking inference defects * Fix inference contract review findings * Preserve conflicting dictionary inputs * Align Ruff pre-commit version * Install training dependency for wheel tests * Refresh audited development dependencies
* Prepare Ethnicolr 2.0 release * Fix release-blocking inference defects * Fix inference contract review findings * Preserve conflicting dictionary inputs * Align Ruff pre-commit version * Install training dependency for wheel tests * Refresh audited development dependencies
Prepare Ethnicolr 2.0 with a coherent inference API, calibrated uncertainty and abstention metadata, PyTorch name models hosted on Hugging Face, typed lookup tables, renamed public functions, refreshed documentation, and standardized CI/release workflows.\n\nThis is intentionally a breaking release with no compatibility aliases.\n\nRelease validation is in progress; do not merge until all local, independent-review, and GitHub CI gates pass.