np_multivariate

NumPy-backed data providers.

class pysatl_cpd.data.providers.plain.np_multivariate.NDArrayMultivariateProvider(data, annotation)[source]

Bases: DataProvider[UnivariateNumericArray, AnnotationT], Generic

Data provider for 2-D NumPy arrays.

Parameters:
Raises:

ValueError – If the data is not 2-dimensional.

__init__(data, annotation)[source]
Parameters:
Return type:

None

__iter__()[source]

Iterate over rows of the multivariate series.

Returns:

Iterator over per-sample feature vectors.

Return type:

Iterator[ndarray[tuple[int], dtype[double]]]

__len__()[source]

Return the series length.

Returns:

Number of samples in the series.

Return type:

int

property annotation: AnnotationT

Return the annotation associated with this timeseries.

Returns:

The annotation object for this series.

Return type:

annotation

property raw_data: MultivariateNumericArray

Return a copy of the underlying data array.

Returns:

Copy of the underlying multivariate numeric array.

Return type:

raw_data

cut(start, stop, *, annotation=None)[source]

Extract a slice of the timeseries data.

Parameters:
  • start (int) – Start index of the slice (inclusive).

  • stop (int) – Stop index of the slice (inclusive).

  • annotation (Optional[TypeVar(AnnotationT, bound= TimeseriesAnnotation)]) – Optional annotation for the sliced data.

Returns:

New provider containing the sliced data.

Return type:

NDArrayMultivariateProvider[TypeVar(AnnotationT, bound= TimeseriesAnnotation)]

classmethod merge(providers, annotation_builder=None)[source]

Merge multiple providers into a single provider.

Parameters:
Returns:

New provider with merged data and annotation.

Return type:

NDArrayMultivariateProvider[TypeVar(AnnotationT, bound= TimeseriesAnnotation)]