probly.utils.sets¶
Utility functions regarding sets.
Functions
|
Compute the capacity of set q given set a. |
|
Compute the Moebius function of a set q given a set a. |
|
Generate the power set of a given iterable. |
- probly.utils.sets.capacity(q, a)[source]¶
Compute the capacity of set q given set a.
- Parameters:
q (np.ndarray) – numpy.ndarray, shape (n_instances, n_samples, n_classes)
a (Iterable[int]) – Iterable, shape (n_classes,), indices indicating subset of classes
- Returns:
numpy.ndarray, shape (n_instances,), capacity of q given a
- Return type:
min_capacity
- probly.utils.sets.moebius(q, a)[source]¶
Compute the Moebius function of a set q given a set a.
- Parameters:
q (np.ndarray) – numpy.ndarray of shape (num_samples, num_members, num_classes)
a (Iterable[int]) – numpy.ndarray, shape (n_classes,), indices indicating subset of classes
- Returns:
numpy.ndarray, shape (n_instances,), moebius value of q given a
- Return type:
m_a