moscot.base.problems.BirthDeathProblem.prepare¶
- BirthDeathProblem.prepare(xy, x, y, a=None, b=None, marginal_kwargs=mappingproxy({}))¶
Prepare the OT problem.
Depending on which arguments are passed, the
problem_kind
will be:if only
xy
is non-empty,problem_kind = 'linear'
.if only
x
andy
are non-empty,problem_kind = 'quadratic'
.if all
xy
,x
andy
are 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
[Any
,dtype
[floating
]],Array
,None
]) –Source marginals. Valid options are:
b (
Union
[bool
,str
,ndarray
[Any
,dtype
[floating
]],Array
,None
]) –Target marginals. Valid options are:
marginal_kwargs (
Dict
[str
,Any
]) – Keyword arguments forestimate_marginals()
whena = True
orb = 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.