Skip to main content

WrapEvoFS

PyPI version Python versions CI License

WrapEvoFS is a Python package for auditable stochastic feature compression. It combines branch-specific screening, RFECV-derived size guidance, repeated genetic searches, and deterministic regret-constrained representative locking for binary or multiclass tabular classification. Selection and locking use development data only; held-out outcomes are not inputs to the locking decision.

Key features

  • corrected untruncated genetic-search objective with separate nonnegative sampling weights;
  • absolute, relative, and best-run-SE-scaled empirical regret modes;
  • Jaccard-medoid locking within the eligible candidate pool;
  • opt-in multi-bank development-only tolerance calibration over observed score gaps;
  • canonical feature-mask encoding and deterministic SHA-256 tie ordering;
  • complete candidate, regret, agreement, seed, and configuration audits;
  • checkpoint/resume support and explicit legacy-compatible modes;
  • CPU execution, with optional supported GPU backends where available.

Installation

WrapEvoFS supports Python 3.10–3.12. Install the latest public release from PyPI:

python -m pip install wrapevofs

For an exact installation with the opt-in calibration API:

python -m pip install wrapevofs==0.3.0

The earlier reference release remains available for reproducing archived analyses:

python -m pip install wrapevofs==0.2.0

For development from a source checkout:

git clone https://github.com/junseoparkX/wrapevofs-package.git
cd wrapevofs-package
python -m venv .venv
python -m pip install --upgrade pip
python -m pip install -e .

Install development tools or optional selectors with:

python -m pip install -e ".[dev]"
python -m pip install -e ".[all]"

Python API

import pandas as pd

from wrapevofs import PipelineConfig, WrapEvoPipeline
from wrapevofs.artifacts import save_pipeline_result

data = pd.read_csv("examples/sample_radiomics.csv")
config = PipelineConfig.from_yaml("configs/synthetic_regret_smoke.yaml")
result = WrapEvoPipeline(config).run_full(
    data,
    target_column="MGMT_binary",
    drop_columns=["patient_id"],
    methods=["svm_l1"],
)
save_pipeline_result(result, "runs/api_smoke")

The bundled CSV is synthetic and contains no participant data.

Command line

wrapevofs run \
  --csv examples/sample_radiomics.csv \
  --target MGMT_binary \
  --drop-columns patient_id \
  --out runs/cli_smoke \
  --config configs/synthetic_regret_smoke.yaml \
  --run-ga

Run wrapevofs run --help for the complete interface. Use wrapevofs --version to report the installed package version. A run with a matching atomic GA state can be continued by repeating its original command with --resume; mismatched or corrupt states are rejected rather than silently starting a new search.

Regret-constrained representative locking

For larger-is-better development scores, candidate regret is the gap from the highest candidate score. The recommended absolute rule first retains only candidates with regret at most the configured tolerance, then selects the candidate with greatest mean Jaccard similarity to the eligible pool. Ties are resolved by higher locking score, smaller feature count, and the stable hash of the canonical mask. The selected candidate therefore always satisfies the configured empirical score-gap constraint. This is an empirical development-score guarantee, not a guarantee of expected predictive risk or external validity.

See configs/recommended_regret_constrained.yaml for the recommended new-analysis settings. Archived configurations preserve the legacy zero-truncated objective and top-k medoid behavior when those modes are selected.

Reproducibility and audit outputs

Optional multi-bank tolerance calibration

Version 0.3.0 adds calibrate_tolerance(banks, *, delta_grid=None, fold_ids=None). It accepts only candidate feature sets, development scores and aligned development fold vectors (plus provenance labels). It searches zero and all observed within-bank score gaps, applies a development-fold SE heuristic, and maximizes fitted cross-bank Jaccard with deterministic ties. An explicit delta_grid supports grid comparisons. Existing pipeline settings, reference defaults, and single-bank locking are unchanged; calibration runs only when called explicitly.

from wrapevofs import LockingCandidate, calibrate_tolerance

banks = {
    "bank_a": [LockingCandidate(0, ["a", "b"], 0.90, [0.88, 0.92])],
    "bank_b": [LockingCandidate(0, ["a", "c"], 0.89, [0.87, 0.91])],
}
fitted = calibrate_tolerance(banks, fold_ids=["split_0", "split_1"])
print(fitted.selected_delta)
print(fitted.curve)

All fold vectors must refer to the same splits in the same order. The SE filter is a training heuristic, with no generalization or noninferiority guarantee. Fitted-bank overlap is an optimization objective and requires separate validation. The retrospective motivating analysis was designed after earlier held-out comparisons and does not establish improved AUROC. See docs/TOLERANCE_CALIBRATION.md for the exact rule, input validation, audits, and the limits of that exploratory evidence. Run python examples/toy_tolerance_calibration.py for a synthetic example.

Locking exports a candidate audit, eligible-pool Jaccard matrix, selected features, and summary metadata under locking/<branch>/. The audit records canonical masks, stable hashes, duplicate multiplicity, scores, regrets, eligibility, agreement, seeds, metric orientation, and configuration hashes. Details are in docs/ARTIFACT_SCHEMA.md, docs/CHECKPOINT_RESUME.md, and REPRODUCIBILITY.md.

Testing

python -m pytest -q
python scripts/run_development_only_smoke.py

The continuous-integration workflow tests Python 3.10, 3.11, and 3.12, builds the wheel and source distribution, checks package metadata, and performs clean-install API and CLI smoke tests.

Citation

Citation metadata are provided in CITATION.cff. Please cite the associated manuscript when it becomes available.

License

WrapEvoFS is distributed under the BSD 3-Clause License.

Metadata

Release files for wrapevofs 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wrapevofs 0.3.0
File Size Uploaded Provenance Actions
wrapevofs-0.3.0.tar.gz 89.0 kB Without provenance Details for wrapevofs-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wrapevofs 0.3.0
File Interpreter ABI Platform Actions
wrapevofs-0.3.0-py3-none-any.whl Python 3 none any Details for wrapevofs-0.3.0-py3-none-any.whl

Total release size: 138.1 kB

Release files / wrapevofs-0.3.0.tar.gz

Download URL wrapevofs-0.3.0.tar.gz
Size 89.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6c9406d0fcdebba102330a4457af70eb062231391d0177ea0d0e2c11718ab689
BLAKE2b-256 checksum
How to use checksums
1e5691ccf8d4993c92db292923b4b01515d51843f1c637d0a2992da85eabc367
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / wrapevofs-0.3.0-py3-none-any.whl

Download URL wrapevofs-0.3.0-py3-none-any.whl
Size 49.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63620119a61ff34d68626f8f1321187d92946c089102d1a38a94e8902ea54883
BLAKE2b-256 checksum
How to use checksums
bcefdd7c25c1408140ac42a65d4fc83c86465008f5cb6f23a33bd2a0c5e13e8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for wrapevofs 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page