experanto.interpolators.Interpolator
- class Interpolator(root_folder)[source]
Bases:
objectAbstract base class for time series interpolation.
Interpolators load data from a modality folder and map time points to data values. Each modality (e.g., screen, responses, eye_tracker, treadmill) is assigned to a separate interpolator object belonging to one of the Interpolator subclasses (e.g., SequenceInterpolator, ScreenInterpolator, etc.), but multiple modalities can belong to the same class, such as treadmill and eye_tracker both being assigned to the SequenceInterpolator subclass.
- Parameters:
root_folder (str) – Path to the modality directory containing data and metadata files.
- root_folder
Path to the modality directory.
- Type:
- valid_interval
Time range for which interpolation is valid.
- Type:
See also
SequenceInterpolatorFor time series data (responses, behaviors).
ScreenInterpolatorFor visual stimuli (images, videos).
TimeIntervalInterpolatorFor labeled time intervals (e.g., train/test splits).
ExperimentHigh-level interface that manages multiple interpolators.
Methods
__init__(root_folder)close()create(root_folder[, cache_data])Factory method to create the appropriate interpolator for a modality.
interpolate(times[, return_valid])Map an array of time points to interpolated data values.
valid_times(times)- abstractmethod interpolate(times, return_valid=False)[source]
Map an array of time points to interpolated data values.
- static create(root_folder, cache_data=False, **kwargs)[source]
Factory method to create the appropriate interpolator for a modality.
Reads the
meta.ymlfile in the folder to determine the modality type and instantiates the corresponding interpolator subclass.- Parameters:
- Returns:
An instance of the appropriate interpolator subclass.
- Return type:
- Raises:
ValueError – If the modality type is not supported.