IndividualNormalization

class eyefeatures.features.shift.IndividualNormalization(pk, independent_features=None, dependent_features=None, inplace=True, use_mean=None, use_std=None, dense_index=True, return_df=True)[source]

Bases: TransformerMixin

Normalization of features based on slices, produced by grouping with primary key.

If dependent_features and independent_features are both None (default), the transformer will automatically discover all numeric columns in the input DataFrame (excluding columns in pk) and normalize them during fit.

Parameters:
  • pk (list[str] | tuple[list[str]]) – primary key to use for grouping.

  • independent_features (dict[str, list[str]] | tuple[dict[str, list[str]]] | list[str]) – features to normalize without fitting statistics (not used on fit). Can be a Dict[str, List[str]], a simple List[str], or None.

  • dependent_features (dict[str, list[str]] | tuple[dict[str, list[str]]] | list[str]) – features to normalize with fitting statistics (calculated on fit). Can be a Dict[str, List[str]], a simple List[str], or None.

  • use_mean (dict[str, Any] | dict[list[str], Any]) – means to use for normalization. Its keys must be same as eyefeatures.utils._get_id output.

  • use_std (dict[str, Any] | dict[list[str], Any]) – standard deviations to use for normalization. Its keys must be same as eyefeatures.utils._get_id output.

  • inplace (bool) – if true, then provided features are normalized inplace, otherwise new columns are created.

  • dense_index (bool) – if true, then grouping keys are converted to strings.

  • return_df (bool) – whether to return output as DataFrame or numpy array.