immuneML.encodings.preprocessing package


immuneML.encodings.preprocessing.FeatureScaler module

class immuneML.encodings.preprocessing.FeatureScaler.FeatureScaler[source]

Bases: object

static normalize(design_matrix, normalization_type: immuneML.analysis.data_manipulation.NormalizationType.NormalizationType)[source]

Normalize on example level so that the norm type applies

  • design_matrix – rows -> examples, columns -> features

  • normalization_type – l1, l2, max, binary, none


normalized design matrix

static standard_scale(scaler_file: pathlib.Path, design_matrix, with_mean: bool = True)[source]

scale to zero mean and unit variance on feature level :param scaler_file: path to scaler file fitted on train set or where the resulting scaler file will be stored :param design_matrix: rows -> examples, columns -> features :param with_mean: whether to scale to zero mean or not (could lose sparsity if scaled) :return: scaled design matrix

Module contents