| Multivariate Pattern Analysis in Python

### Navigation

- index
- next |
- previous |
- ExpPsy Project |
- NeuroDebian Project |
- PyMVPA 0.4.x Home |
- PyMVPA Home |
- Documentation »
- Module Reference »

This content refers to the previous stable release of PyMVPA. Please visit www.pymvpa.org for the most recent version of PyMVPA and its documentation.

# datasets.event

## Module: `datasets.event`

Inheritance diagram for `mvpa.datasets.event`:

Event-based dataset type

## `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.

### Navigation

- index
- next |
- previous |
- ExpPsy Project |
- NeuroDebian Project |
- PyMVPA 0.4.x Home |
- PyMVPA Home |
- Documentation »
- Module Reference »