You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class HierarchicalStructure(BaseMixin):
def __init__(self, level_structure: Dict[str, List[str]], level_names: Optional[List[str]]=None):
"""Init HierarchicalStructure.
Parameters
----------
level_structure:
Adjacency list describing the structure of the hierarchy tree (i.e. {"total":["X", "Y"], "X":["a", "b"], "Y":["c", "d"]})
level_names:
Names of levels in the hierarchy in the order from top to bottom (i.e. ["total", "category", "product"]), if None is passed, generate level names
"""
pass
Check that structure defines a tree
Check that number of levels is the same as depth of the tree
Create attribute _level_series with mapping {"level": [list of segments]}
Create adjacency matrix out of adjacency list and store it in sparce format
Create method to generate summing matrix between levels:
🚀 Feature Request
Create class to handle hierarchical structure
Proposal
_level_series
with mapping {"level": [list of segments]}Test cases
get_summing_matrix
generates correct matrixlevel_names
andget_level_segments
Additional context
No response
The text was updated successfully, but these errors were encountered: