pasteur.hierarchy#
Description
Highly experimental and unpublished class for rebalancing Stratified Values with Differential Privacy.
@TODO: Documentation.
Functions
|
Traverses tree and creates an array which maps nodes to groups such that: |
|
Receives the top node of the tree of a hierarchical attribute and converts it into the same tree structure, where the leaves have been replaced by bucket groups, with each bucket group containing the node it replaced. |
|
Finds groups a, b which when combined form c, where c is the smallest group that can be formed by any two nodes in the tree, which are valid to merge. |
|
Takes in a max_domain value and uses it to produce a new increasing domain list, based on u and fixed. |
|
|
|
|
|
|
|
Returns the sum of the sizes of the buckets included in set g. |
|
|
|
|
|
Computes c = a intersection b and inserts it into node, by replacing a with c and removing b. |
|
Converts the group into a string representation: (False, False, True, True, False) -> (2,3) |
|
Converts a tree into a human ledgible representation. |
|
Replaces all nodes in the tree where len(node) == 1 with their children. |
|
Classes
|
|
|
|
|
|
|