moscot.base.problems.OTProblem.prepare¶
- OTProblem.prepare(xy, x, y, a=None, b=None, marginal_kwargs=mappingproxy({}))[source]¶
Prepare the OT problem.
Depending on which arguments are passed, the
problem_kindwill be:if only
xyis non-empty,problem_kind = 'linear'.if only
xandyare non-empty,problem_kind = 'quadratic'.if all
xy,xandyare non-empty,problem_kind = 'quadratic'.
- Parameters:
xy (
Mapping[str,Any]) – Geometry defining the linear term. If a non-emptydict,from_adata()will be called.x (
Mapping[str,Any]) – Geometry defining the source quadratic term. If a non-emptydict,from_adata()will be called.y (
Mapping[str,Any]) – Geometry defining the target quadratic term. If a non-emptydict,from_adata()will be called.a (
Union[bool,str,ndarray[tuple[int,...],dtype[floating]],Array,None]) –Source marginals. Valid options are:
b (
Union[bool,str,ndarray[tuple[int,...],dtype[floating]],Array,None]) –Target marginals. Valid options are:
marginal_kwargs (
Dict[str,Any]) – Keyword arguments forestimate_marginals()whena = Trueorb = True.
- Return type:
- Returns:
: Self and updates the following fields:
xy- geometry of shape[n, m]defining the linear term.x- geometry of shape[n, n]defining the source quadratic term.y- geometry of shape[m, m]defining the target quadratic term.stage- set to'prepared'.problem_kind- kind of the OT problem.