source
generate_series
Generate Synthetic Panel Series.generate_series (n_series:int, freq:str='D', min_length:int=50, max_length:int=500, n_static_features:int=0, equal_ends:bool=False, with_trend:bool=False, static_as_categorical:bool=True, n_models:int=0, level:Optional[List[float]]=None, engine:Literal['pandas','polars']='pandas', seed:int=0)
| Type | Default | Details | |
|---|---|---|---|
| n_series | int | Number of series for synthetic panel. | |
| freq | str | D | Frequency of the data (pandas alias). Seasonalities are implemented for hourly, daily and monthly. |
| min_length | int | 50 | Minimum length of synthetic panel’s series. |
| max_length | int | 500 | Maximum length of synthetic panel’s series. |
| n_static_features | int | 0 | Number of static exogenous variables for synthetic panel’s series. |
| equal_ends | bool | False | Series should end in the same timestamp. |
| with_trend | bool | False | Series should have a (positive) trend. |
| static_as_categorical | bool | True | Static features should have a categorical data type. |
| n_models | int | 0 | Number of models predictions to simulate. |
| level | Optional | None | Confidence level for intervals to simulate for each model. |
| engine | Literal | pandas | Output Dataframe type. |
| seed | int | 0 | Random seed used for generating the data. |
| Returns | Union | Synthetic panel with columns [unique_id, ds, y] and exogenous features. |
synthetic_panel = generate_series(n_series=2)
synthetic_panel.groupby('unique_id', observed=True).head(4)
| unique_id | ds | y | |
|---|---|---|---|
| 0 | 0 | 2000-01-01 | 0.357595 |
| 1 | 0 | 2000-01-02 | 1.301382 |
| 2 | 0 | 2000-01-03 | 2.272442 |
| 3 | 0 | 2000-01-04 | 3.211827 |
| 222 | 1 | 2000-01-01 | 5.399023 |
| 223 | 1 | 2000-01-02 | 6.092818 |
| 224 | 1 | 2000-01-03 | 0.476396 |
| 225 | 1 | 2000-01-04 | 1.343744 |

