timeseries_preprocessing
timeseries_preprocessing
¶
Time series preprocessing utilities for Safe Synthesizer training.
Functions:
| Name | Description |
|---|---|
process_timeseries_data |
Process time series data and validate/infer timestamp parameters. |
process_timeseries_data(df_all, config)
¶
Process time series data and validate/infer timestamp parameters.
This function: 1. Creates a timestamp column if one doesn't exist 2. Validates the timestamp column exists and has no missing values 3. Sorts the data by timestamp 4. Infers timestamp_format from the data 5. Validates or infers timestamp_interval_seconds 6. Sets start_timestamp and stop_timestamp
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df_all
|
DataFrame
|
The input DataFrame |
required |
config
|
SafeSynthesizerParameters
|
The configuration object with time_series settings |
required |
Returns:
| Type | Description |
|---|---|
tuple[DataFrame, SafeSynthesizerParameters]
|
Tuple of (processed DataFrame, updated config) |
Raises:
| Type | Description |
|---|---|
ParameterError
|
If timestamp column is not found |
DataError
|
If timestamp column has missing values or intervals are inconsistent |