This release is a pre-release and may not be stable for production use.
yemale
Prediction regions and predictive distributions for your model.
yemale adds uncertainty estimates to a fitted model without changing its predictions. It handles one output or several outputs together, such as a location's two coordinates. Choose a distribution to generate possible outcomes and compute means and covariances.
Under the hood, it uses multivariate conformal prediction and optimal transport, with scalar or vector-valued scores. The transport engine also works on its own.
Install
Requires Python 3.10 or later.
python -m pip install yemale==0.1.0a1
The API may change before 1.0; see the changelog.
With your model
Start with a fitted model and held-out data X_cal, y_cal that were not used
to train it. These data are used to calibrate the prediction regions.
from yemale import extend
model = extend(model)
model.conformalize(X_cal, y_cal)
cpd = model.predict_distribution(X_new)
region = cpd.region(0.9, rng=0)
region.contains(y_new) # One Boolean per new outcome.
model.predict(X_new) still returns the original point predictions.
By default, yemale uses the prediction errors, outcomes - predictions.
Pass arrays of shape (n,) for one output or (n, d) for several outputs.
Regions use randomization; rng=0 makes the example reproducible. The requested
coverage holds on average under the
documented assumptions.
Already have predictions? Use yemale.conformalize(predictions, outcomes)
directly; extend only connects this operation to your model.
Sampling and summaries
To generate possible outcomes, first choose a distribution. This example uses
candidate= to construct one for a single new input. The candidate is the
model's prediction and stays fixed while we draw samples:
candidate = model.predict(X_new[:1])[0]
cpd = model.predict_distribution(X_new[:1], candidate=candidate)
cpd.sample(1000, rng=0)
cpd.mean()
cpd.cov()
You can also choose your own distribution
with law=. The coverage guarantee for regions does not automatically apply
to the distribution used for sampling.
Explore
- Conformal prediction: use a model or prediction arrays, test outcomes, and select candidates.
- Optimal transport: fit point clouds, construct regions, and work with reference and predictive distributions.
- Mathematical guide: the construction and its connection to the API.
License
Apache-2.0.
Metadata
Release files for yemale 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yemale-0.1.0a1.tar.gz | 71.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yemale-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 122.9 kB
Release files / yemale-0.1.0a1.tar.gz
| Download URL | yemale-0.1.0a1.tar.gz |
|---|---|
| Size | 71.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40c5a2033c4b5d714d9b6e6a3604bd2fd663a4e032078e60a5a22f14cda87bde
|
|
BLAKE2b-256 checksum How to use checksums |
33c6f29ee4bdce18ae4c099e457461afca85a029ac49b0bd1f9adde8d9a60564
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / yemale-0.1.0a1-py3-none-any.whl
| Download URL | yemale-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 51.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c724960988ddf4843e6560826dcb222d769f6e451661462bff883fa10b177f3f
|
|
BLAKE2b-256 checksum How to use checksums |
bae2952882992c81b99150bcdbc1f920c45184e72df59fd32cfe7e56d0c4da52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency log