state_dataset
Datasets of fixed-state labeled time series.
- class pysatl_cpd.data.dataset.state_dataset.StateDataset(timeseries, *, state=None)[source]
Bases:
IDataset[DataT,NoChangeSeriesAnnotation],GenericDataset of fixed-state series without change points.
All series in this dataset share a common state and have no change points within them. Typically created from a larger Dataset by slicing fixed-state segments.
- Parameters:
timeseries (
Sequence[LabeledData[TypeVar(DataT),NoChangeSeriesAnnotation]]) – Sequence of labeled data instances sharing the same state.state (
StateDescriptor|None) – Optional explicit state descriptor; derived from the first timeseries if not provided.
- __init__(timeseries, *, state=None)[source]
- Parameters:
timeseries (Sequence[LabeledData[DataT, NoChangeSeriesAnnotation]])
state (StateDescriptor | None)
- Return type:
None
- property state: StateDescriptor
Return the fixed state descriptor for this dataset.
- Returns:
State descriptor for all timeseries in the dataset.
- Return type:
- classmethod from_dataset(dataset, slice_length, *, state, keep_remainder=False)[source]
Create a StateDataset from a Dataset by filtering and slicing.
- Parameters:
- Returns:
New StateDataset with sliced timeseries.
- Return type:
StateDataset[TypeVar(DataT)]- Raises:
ValueError – If slice_length is not positive, or no segments are found for the given state.