etna.datasets.generate_hierarchical_df#
- generate_hierarchical_df(periods: int, n_segments: List[int], freq: str = 'D', start_time: str = '2000-01-01', ar_coef: list | None = None, sigma: float = 1, random_seed: int = 1) DataFrame[source]#
Create DataFrame with hierarchical structure and AR process data.
- The hierarchical structure is generated as follows:
Number of levels in the structure is the same as length of
n_segmentsparameterEach level contains the number of segments set in
n_segmentsConnections from parent to child level are generated randomly.
- Parameters:
- Returns:
DataFrame at the bottom level of the hierarchy
- Raises:
ValueError: –
n_segmentsis emptyValueError: –
n_segmentscontains not positive integersValueError: –
n_segmentsrepresents not non-decreasing sequence
- Return type: