Getting started#
Candidate-augmented optimal transport for vector point clouds.
The default reference target also provides multivariate ranks and quantile regions.
Fit n source points once. Each query adds its candidate to an optimal assignment
of n + 1 points, without solving a new assignment problem.
Install#
Requires Python 3.10–3.14.
python -m pip install "git+https://github.com/yemale/yemale.git@main"
Quantile regions#
import numpy as np
import yemale.ot as ot
source = np.random.default_rng(0).normal(size=(99, 2))
T = ot.fit(source)
region = T.quantile_region(coverage=0.9)
region.contains([[0.2, 0.4], [5.0, 5.0]]) # array([True, False])
region.coverage # 0.9
Queries accept one point or a batch. region.coverage gives the achieved level,
which can exceed the request when whole cells are included together.
See the guide for coverage assumptions.
Distributions#
The reference distribution has uniform radius and direction in the unit ball.
nu = T.reference
nu.sample(size=1000, rng=0)
nu.mean()
nu.covariance()
To sample in source space, choose how probability fills each assigned cell. The predictive distribution example shows that choice, sampling, and expectations in one runnable workflow.
The guide also covers ranks, assignments, potentials, and smoothing.