ladder.data.real_data.construct_labels#
- ladder.data.real_data.construct_labels(counts, metadata, factors, style='concat', batch_key=None)#
Function to generate conditional labels for the various models included.
- Parameters:
counts – The field corresponding to
X.metadata – The field corresponding to
obs.factors (array_like) – 1D Array-like of
str. The list specifying factors, which are names of the columns fromobs.style (
Literal["concat", "one-hot"]) – Specifies the label encoding.batch_key (
str, optional) – Specifies the batch key, must be included inobs.
- Return type:
- Returns:
- dataset
TensorDataset The dataset object to be used downstream.
- levels
dict A mapping between the literal combinations of
factorsand their numerical equivalents.- converter
AnndataConverter The converter object with the associated dataset.
- batch_mapping
dict Returned only if
batch_keyis given. Ordinal encoding for the batch dimension.
- dataset