statsmodels.sandbox.stats.multicomp.set_partition

statsmodels.sandbox.stats.multicomp.set_partition(ssli)[source]

extract a partition from a list of tuples

this should be correctly called select largest disjoint sets. Begun and Gabriel 1981 do not seem to be bothered by sets of accepted hypothesis with joint elements, e.g. maximal_accepted_sets = { {1,2,3}, {2,3,4} }

This creates a set partition from a list of sets given as tuples. It tries to find the partition with the largest sets. That is, sets are included after being sorted by length.

If the list does not include the singletons, then it will be only a partial partition. Missing items are singletons (I think).

Examples

>>> li
[(5, 6, 7, 8), (1, 2, 3), (4, 5), (0, 1)]
>>> set_partition(li)
([(5, 6, 7, 8), (1, 2, 3)], [0, 4])