flexible_timeseries
flexible_timeseries
¶
Preparation and validation for automatically routed flexible time series.
Functions:
| Name | Description |
|---|---|
resolve_flexible_timeseries_metadata |
Resolve internal control columns and timestamp checks for flexible routing. |
prepare_flexible_timeseries_data |
Transform source data into the internal flexible representation. |
finalize_flexible_timeseries_controls |
Recompute flexible control columns after training-time preprocessing. |
resolve_flexible_timeseries_metadata(data, config, max_records, source_timestamp_format)
¶
Resolve internal control columns and timestamp checks for flexible routing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
Source time-series data. |
required |
config
|
SafeSynthesizerParameters
|
Parameters with the effective source timestamp column already resolved. |
required |
max_records
|
int
|
Largest source-group length. |
required |
source_timestamp_format
|
str
|
Validated or inferred format of the source timestamp column. |
required |
Returns:
| Type | Description |
|---|---|
FlexibleTimeseriesMetadata
|
Flexible controls persisted with the model and used by generation. |
Source code in src/nemo_safe_synthesizer/data_processing/flexible_timeseries.py
prepare_flexible_timeseries_data(data, config, metadata, source_timestamp_format)
¶
Transform source data into the internal flexible representation.
Rows are stably ordered within each group before the sequence index and final-row marker are added. The resolved configuration is updated to use the generated index as its generation-time timestamp.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
Source time-series data. |
required |
config
|
SafeSynthesizerParameters
|
Parameters to update with the resolved internal columns. |
required |
metadata
|
FlexibleTimeseriesMetadata
|
Resolved control-column names and sequence-length cap. |
required |
source_timestamp_format
|
str
|
Format used to normalize timestamp ordering. |
required |
Returns:
| Type | Description |
|---|---|
tuple[DataFrame, str]
|
The transformed data and effective group-column name. |
Source code in src/nemo_safe_synthesizer/data_processing/flexible_timeseries.py
finalize_flexible_timeseries_controls(data, config, metadata)
¶
Recompute flexible control columns after training-time preprocessing.
Preprocessing actions can drop rows after the sequence index and final-row marker were assigned, which would leave index gaps or groups without a final-row marker. Indices and markers are reassigned in the current row order, and the record cap is updated to the longest remaining group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
Preprocessed training data in the flexible representation. |
required |
config
|
SafeSynthesizerParameters
|
Resolved parameters; the generation stop timestamp is updated. |
required |
metadata
|
FlexibleTimeseriesMetadata
|
Flexible metadata resolved before preprocessing. |
required |
Returns:
| Type | Description |
|---|---|
tuple[DataFrame, FlexibleTimeseriesMetadata]
|
The data with consistent control columns and the updated metadata. |