Table Of Contents

Previous topic

mvpa.datasets.eep

Next topic

mvpa.datasets.mapped

This Page

Quick search

mvpa.datasets.event

Event-based dataset type

The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.datasets.event (for developers).

EventDataset

class mvpa.datasets.event.EventDataset(samples=None, events=None, mask=None, bcshape=None, dametric=None, **kwargs)

Bases: mvpa.datasets.mapped.MappedDataset

Event-based dataset

This dataset type can be used to segment ‘raw’ data input into meaningful boxcar-shaped samples, by simply defining a list of events (see Event).

Additionally, it can be used to add arbitrary information (as features) to each event-sample (extracted from the event list itself). An appropriate mapper is automatically constructed, that merges original samples and additional features into a common feature space and also separates them again during reverse-mapping. Otherwise, this dataset type is a regular dataset (in contrast to MetaDataset).

The properties of an Event supported/required by this class are:

onset
An integer indicating the startpoint of an event as the sample index in the input data.
duration
How many input data samples following the onset sample should be considered for an event. The embedded BoxcarMapper will use the maximum boxlength (i.e., duration) of all defined events to create a regular-shaped data array.
label
The corresponding label of that event (numeric or literal).
chunk
An optional chunk id.
features
A list with an arbitrary number of features values (floats), that will be added to the feature vector of the corresponding sample.
Parameters:
  • samples (ndarray) – ‘Raw’ input data from which boxcar-shaped samples will be extracted.
  • events (sequence of Event instances) – Both an events onset and duration are assumed to be provided as #samples. The boxlength will be determined by the maximum duration of all events.
  • mask (boolean array) – Only features corresponding to non-zero mask elements will be considered for the final dataset. The mask shape either has to match the shape of the generated boxcar-samples, or the shape of the ‘raw’ input samples. In the latter case, the mask is automatically expanded to cover the whole boxcar. If no mask is provided, a full mask will be constructed automatically.
  • bcshape (tuple) – Shape of the boxcar samples generated by the embedded boxcar mapper. If not provided this is determined automatically. However, this required an extra mapping step.
  • dametric (Metric) – Custom metric to be used by the embedded DenseArrayMapper.
  • **kwargs – All additional arguments are passed to the base class.

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the EventDataset documentation.

Full API documentation of EventDataset in module mvpa.datasets.event.