Skip to main content

feature_calculators.compute_aggregated_features

feature_calculators.compute_aggregated_features(
    calculator,
    windows,
    options=None,
    on_overlap='raise',
    n_jobs=1,
)

Compute features on several snippets, then aggregate and denoise them.

Each snippet is computed with calculator.compute_snippet, then the snippets are aggregated by aggregate_snippets.

Args: calculator (BaseFeatureCalculator): Calculator of the recording. windows (Sequence[SnippetWindow]): Snippet windows, e.g. from get_snippet_start_times. options (FeatureComputationOptions, optional): Options of every snippet computation. The aggregation reads the snippet features from disk: without output_dir they are written to a temporary folder, removed afterwards. on_overlap (str): "raise" or "warn" when windows overlap. n_jobs (int): Snippets computed in parallel with joblib (the calculator must pickle).

Returns: pd.DataFrame: Aggregated and denoised features indexed by (pid, channel), with pid = calculator.name, and the snippet windows and code versions in df.attrs (see aggregate_snippets).