dataset

Dataset generators.

class pysatl_cpd.data.generator.dataset.LabeledDataGenerator(*args, **kwargs)[source]

Bases: Protocol, Generic

Protocol for generating labeled data instances.

generate(annotation=None, name=None)[source]

Generate a labeled data instance.

Parameters:
Returns:

Generated labeled data instance.

Return type:

TypeVar(DataT, bound= LabeledData[Any, TimeseriesAnnotation])

__init__(*args, **kwargs)
class pysatl_cpd.data.generator.dataset.ScenarioDatasetGenerator(scenarios, *, seed=None)[source]

Bases: object

Generator for creating datasets from scenario specifications.

Parameters:
  • scenarios (dict[str, ScenarioSpec]) – Dictionary mapping scenario names to specifications.

  • seed (int | None) – Optional random seed for reproducibility.

Raises:

ValueError – If scenarios is empty.

__init__(scenarios, *, seed=None)[source]
Parameters:
Return type:

None

property scenarios: dict[str, ScenarioSpec]

Get the scenario specifications.

Returns:

Dictionary mapping scenario names to specifications.

Return type:

scenarios

generate(scenario, size)[source]

Generate a dataset from a scenario.

Parameters:
  • scenario (str) – Name of the scenario to generate from.

  • size (int) – Number of data instances to generate.

Returns:

Generated dataset with labeled data.

Return type:

Dataset[Any, TimeseriesAnnotation]

Raises:

ValueError – If size is not positive, or the scenario name is unknown.