att.neuro

att.neuro.get_fallback_params(band='broadband', sfreq=256.0)[source]

Return default Takens-embedding parameters for an EEG frequency band.

Parameters:
  • band (str) – One of "broadband", "alpha", "theta_alpha", "gamma".

  • sfreq (float) – Sampling frequency in Hz. Delay values are scaled relative to the base rate of 256 Hz so that the physical lag stays approximately constant across sampling rates.

Returns:

Keys: delay, dimension, bandpass, note.

Return type:

dict

Raises:

ValueError – If band is not one of the known bands.

att.neuro.embed_channel(channel_data, band='broadband', sfreq=256.0, condition_threshold=10000.0)[source]

Embed a single EEG channel with auto-estimation and fallback.

Strategy: 1. Try TakensEmbedder(“auto”, “auto”) 2. validate_embedding() — check condition number 3. If degenerate or estimation fails: re-embed with fallback_params

Parameters:
  • channel_data (1D array of EEG samples)

  • band (frequency band for fallback params)

  • sfreq (sampling frequency in Hz)

  • condition_threshold (condition number threshold for degeneracy)

Returns:

method: “auto” or “fallback” delay: int dimension: int condition_number: float fallback_reason: str or None

Return type:

(point_cloud, metadata) where metadata is a dict with

class att.neuro.EEGLoader(data_path, subject=1)[source]

Bases: object

Load and preprocess EEG data from common formats.

Supports BDF, EDF, SET (EEGLAB), FIF, and .mat files via MNE-Python.

Parameters:
  • data_path (str or Path) – Path to the EEG data file.

  • subject (int or str) – Subject identifier (informational, stored as metadata).

load()[source]

Load raw EEG data based on file extension.

Return type:

mne.io.Raw

preprocess(bandpass=(1, 45), notch=50.0, reference='average', ica_reject=False)[source]

Apply standard preprocessing pipeline.

Parameters:
  • bandpass ((low, high) Hz)

  • notch (line noise frequency (None to skip))

  • reference (re-referencing scheme ("average" or channel name))

  • ica_reject (whether to run ICA artifact rejection (slow))

Return type:

mne.io.Raw

to_timeseries(picks=None)[source]

Extract channel data as numpy array.

Parameters:

picks (channel names to extract (None = all EEG))

Return type:

(n_channels, n_samples) array, list of channel names

get_events()[source]

Extract events from annotations or STIM channels.

Return type:

(n_events, 3) array [sample, 0, event_id] or None if no events found.

get_sfreq()[source]

Return sampling frequency.

Return type:

float

static get_channel_groups()[source]

Return standard 10-20 channel groups for region-of-interest analysis.

Return type:

dict[str, list[str]]

static get_fallback_params(band='broadband', sfreq=256.0)[source]

Convenience method delegating to eeg_params.get_fallback_params.

Parameters:
Return type:

dict

class att.neuro.EEGLoader(data_path, subject=1)[source]

Bases: object

Load and preprocess EEG data from common formats.

Supports BDF, EDF, SET (EEGLAB), FIF, and .mat files via MNE-Python.

Parameters:
  • data_path (str or Path) – Path to the EEG data file.

  • subject (int or str) – Subject identifier (informational, stored as metadata).

__init__(data_path, subject=1)[source]
Parameters:
load()[source]

Load raw EEG data based on file extension.

Return type:

mne.io.Raw

preprocess(bandpass=(1, 45), notch=50.0, reference='average', ica_reject=False)[source]

Apply standard preprocessing pipeline.

Parameters:
  • bandpass ((low, high) Hz)

  • notch (line noise frequency (None to skip))

  • reference (re-referencing scheme ("average" or channel name))

  • ica_reject (whether to run ICA artifact rejection (slow))

Return type:

mne.io.Raw

to_timeseries(picks=None)[source]

Extract channel data as numpy array.

Parameters:

picks (channel names to extract (None = all EEG))

Return type:

(n_channels, n_samples) array, list of channel names

get_events()[source]

Extract events from annotations or STIM channels.

Return type:

(n_events, 3) array [sample, 0, event_id] or None if no events found.

get_sfreq()[source]

Return sampling frequency.

Return type:

float

static get_channel_groups()[source]

Return standard 10-20 channel groups for region-of-interest analysis.

Return type:

dict[str, list[str]]

static get_fallback_params(band='broadband', sfreq=256.0)[source]

Convenience method delegating to eeg_params.get_fallback_params.

Parameters:
Return type:

dict

Auto-with-fallback embedding for EEG channel data.

att.neuro.embedding.embed_channel(channel_data, band='broadband', sfreq=256.0, condition_threshold=10000.0)[source]

Embed a single EEG channel with auto-estimation and fallback.

Strategy: 1. Try TakensEmbedder(“auto”, “auto”) 2. validate_embedding() — check condition number 3. If degenerate or estimation fails: re-embed with fallback_params

Parameters:
  • channel_data (1D array of EEG samples)

  • band (frequency band for fallback params)

  • sfreq (sampling frequency in Hz)

  • condition_threshold (condition number threshold for degeneracy)

Returns:

method: “auto” or “fallback” delay: int dimension: int condition_number: float fallback_reason: str or None

Return type:

(point_cloud, metadata) where metadata is a dict with

Fallback Takens-embedding parameters for common EEG frequency bands.

Sources:

Stam, C. J. (2005). Nonlinear dynamical analysis of EEG and MEG. Lehnertz, K. & Elger, C. E. (1998). Can epileptic seizures be predicted?

att.neuro.eeg_params.get_fallback_params(band='broadband', sfreq=256.0)[source]

Return default Takens-embedding parameters for an EEG frequency band.

Parameters:
  • band (str) – One of "broadband", "alpha", "theta_alpha", "gamma".

  • sfreq (float) – Sampling frequency in Hz. Delay values are scaled relative to the base rate of 256 Hz so that the physical lag stays approximately constant across sampling rates.

Returns:

Keys: delay, dimension, bandpass, note.

Return type:

dict

Raises:

ValueError – If band is not one of the known bands.