cellxgene_census.experimental.ml.encoders.LabelEncoder

class cellxgene_census.experimental.ml.encoders.LabelEncoder(col: str)

Default encoder based on sklearn.preprocessing.LabelEncoder.

__init__(col: str) None

Methods

__init__(col)

fit(obs)

Fit the encoder with obs.

inverse_transform(encoded_values)

Inverse transform the encoded values back to the original values.

transform(df)

Transform the obs pandas.DataFrame into a pandas.DataFrame of encoded values.

Attributes

classes_

Classes of the encoder.

columns

Columns in obs that the encoder will be applied to.

name

Name of the encoder.