Extractor

class eyefeatures.features.extractor.Extractor(features=None, x=None, y=None, t=None, duration=None, dispersion=None, aoi=None, path_pk=None, pk=None, expected_paths_method='mean', extra=None, aggr_extra=None, warn=True, leave_pk=False, return_df=True)[source]

Bases: BaseEstimator, TransformerMixin

Meta Transformer that encapsulates the logic of feature extraction, providing fit/transform API.

Parameters:
  • features (list[BaseTransformer]) – List of feature transformers to use.

  • x (str) – X coordinate column name.

  • y (str) – Y coordinate column name.

  • t (str) – timeseries coordinate column name.

  • duration (str) – fixation duration column name.

  • dispersion (str) – fixation dispersion column name.

  • aoi (str) – AOI column name.

  • path_pk (list[str]) – list of columns by which to calculate expected path.

  • pk (list[str]) – list of columns to use as primary key.

  • expected_paths_method (str) – the method to calculate expected path.

  • extra (list[str]) – used in combination with aggr_extra. List of columns of input dataframe (on transform) to aggregate alongside with other feature transformers, using aggregation function aggr_extra.

  • aggr_extra (Callable | str) – aggregation function (pandas str or custom callable) to apply with extra argument.

  • warn (bool) – whether to enable warnings.

  • leave_pk (bool) – if True, then input pk columns are present in output dataframe (after transform).

  • return_df (bool) – if True, then pandas DataFrame is returned, else np.ndarray.

Usage example.