time_series
Time series feature types.
Classes:
| Name | Description |
|---|---|
TimeSeriesFeature |
Feature representing a temporal sequence of sub-features. |
UnivariateTimeSeriesFeature |
Alias type representing a univariate time series. |
MultivariateTimeSeriesFeature |
Feature representing a multivariate time series. |
TimeSeriesFeature
#
Feature representing a temporal sequence of sub-features.
A time series feature encodes a sequence of feature instances observed over time.
Each element in the series shares the same feature type and structure, defined by
the items attribute. This representation is suitable for modeling dynamic
signals, evolving states, or sequential sensor measurements.
The asynchronous flag indicates cross-instance temporal alignment at the dataset
level: when True, different samples in the dataset need not be aligned in time
(for example, sequences may have different start times,or sampling
schedules). When False, sequences across instances are expected to be aligned
(for example, same timestamps or a shared index), enabling direct time-wise
comparisons.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ItemType
|
The feature type representing each element in the temporal sequence. This defines the internal structure and semantics of the time-dependent data. |
required |
|
bool
|
Indicate whether sequences across dataset instances are temporally aligned. If True, instances may be misaligned (different start times, lengths, or grids). If False, instances are aligned to a common temporal reference. |
False
|
|
tuple[str, str] or str or None
|
Define the link to another feature for visualization in XpViz. - A string refers to the feature name of another time series. - A tuple (feature_name, channel_name) refers to a channel within another multivariate time series feature. |
None
|
Notes
This class does not prescribe intra-sequence sampling regularity. Individual
sequences may be regularly or irregularly sampled regardless of the value of
asynchronous.
- Current limitation: Xpdeep does not yet support variable-length sequences. Please pad all sequences to a uniform length before using this feature.
Tip
If your architecture requires explicit temporal information (for example, to encode absolute or relative time), consider adding a new feature timestamp of type TimeSeries[Numerical] to your schema. This feature can represent time indices or real-world timestamps aligned with the sequence entries and will be accessible by your model.
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
items |
ItemType
|
|
name |
Literal['TIMESERIES']
|
|
asynchronous |
bool
|
|
channel |
tuple[str, str] | str | None
|
|
items: ItemType
#
name: Literal['TIMESERIES'] = 'TIMESERIES'
#
asynchronous: bool = attrs.field(default=False, kw_only=True)
#
channel: tuple[str, str] | str | None = attrs.field(default=None, kw_only=True)
#
to_model() -> TimeseriesFeatureTypeInput
#
Convert to a TimeseriesFeatureTypeInput instance.
Returns:
| Type | Description |
|---|---|
TimeseriesFeatureTypeInput
|
Model-level representation of the time series feature, including its temporal structure and asynchronicity flag. |
Source code in src/xpdeep/dataset/feature/feature_types/time_series.py
from_model(feature_type_input: TimeseriesFeatureTypeInput) -> TimeSeriesFeature[ItemType]
#
Instantiate from a json response.
Source code in src/xpdeep/dataset/feature/feature_types/time_series.py
UnivariateTimeSeriesFeature
#
Alias type representing a univariate time series.
This feature models a temporal sequence of numerical values observed over time,
corresponding to a single channel or variable. It is equivalent to a
TimeSeriesFeature composed of a single NumericalFeature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
|
False
|
|
str
|
|
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |
MultivariateTimeSeriesFeature
#
Feature representing a multivariate time series.
This feature models a temporal sequence of synchronized numerical channels.
Each time step is represented as a vector of numerical values, one per channel.
It is equivalent to a TimeSeriesFeature of a VectorFeature composed of
numerical sub-features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
|
False
|
|
str
|
|
None
|
|
str
|
|
required |
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |