scdef.sscDEF ¶
Bases: scDEF
Supervised scDEF (sscDEF): cell-type labels fix the top hierarchy. Experimental.
Experimental
sscDEF has unit tests covering its construction and layer shapes, but it
has not been validated on real data and is not actively developed. Prefer
scDEF for unsupervised fits and iscDEF
when you have marker gene lists. Expect rough edges, and check any result
it produces.
Layer sizes and W priors match scDEF (geometric schedule from
n_factors / n_layers, or explicit layer_sizes). By default a width-1 root is appended above the supervised top layer (fitted in a
second phase via root_epochs, default 10). Pass add_root=False to use only
the supervised layer as the coarsest level.
Top-layer cell-factor usage z is fixed to binary assignments (1 on the annotated
population, near-zero elsewhere). During fitting the top z is not sampled from
the variational posterior and its parameters are not optimized; all other layers
are learned as in scDEF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adata
|
AnnData
|
AnnData with counts in |
required |
top_key
|
str
|
|
required |
add_root
|
bool
|
if True (default), append a width-1 root above the supervised top layer. |
True
|
**kwargs
|
Any
|
forwarded to |
{}
|
Methods:
| Name | Description |
|---|---|
fit |
Fit sscDEF; the supervised top layer |