flippers.conflicts#

flippers.conflicts(L, polarities)#

Calculate the number of fraction of labeled samples labeled differently by other labeling functions for each labeling function.

Parameters:
  • L (pd.DataFrame) – Weak label DataFrame of shape (n_samples, n_weak).

  • L – Weak label DataFrame of shape (n_samples, n_weak).

  • polarities (Union[list, np.ndarray]) – Array or list of size n_weak containing the polarity of each weak label.

Returns:

Series of length n_weak indicating the fraction of annotated samples with conflicting annotations for each LF.

Return type:

pd.Series

Example

>>> L = pd.DataFrame([[0, 1, 0], [1, 0, 1], [0, 0, 0], [1, 1, 1]])
>>> flippers.conflicts(L, polarities)
0    0.50
1    0.25
2    0.50
dtype: float64