MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / get_support

Function get_support

graphs/frequent_pattern_graph_miner.py:99–110  ·  view source on GitHub ↗

Returns support >>> get_support({5: {'11111': ['ab', 'ac', 'df', 'bd', 'bc']}, ... 4: {'11101': ['ef', 'eg', 'de', 'fg'], '11011': ['cd']}, ... 3: {'11001': ['ad'], '10101': ['dg']}, ... 2: {'10010': ['dh', 'bh'], '11000': ['be'], '101

(cluster)

Source from the content-addressed store, hash-verified

97
98
99def get_support(cluster):
100 """
101 Returns support
102 >>> get_support({5: {'11111': ['ab', 'ac', 'df', 'bd', 'bc']},
103 ... 4: {'11101': ['ef', 'eg', 'de', 'fg'], '11011': ['cd']},
104 ... 3: {'11001': ['ad'], '10101': ['dg']},
105 ... 2: {'10010': ['dh', 'bh'], '11000': ['be'], '10100': ['gh'],
106 ... '10001': ['ce']},
107 ... 1: {'00100': ['fh', 'eh'], '10000': ['hi']}})
108 [100.0, 80.0, 60.0, 40.0, 20.0]
109 """
110 return [i * 100 / len(cluster) for i in cluster]
111
112
113def print_all() -> None:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected