SecondOrderWassersteinDecomposition

class probly.quantification.decomposition.wasserstein.SecondOrderWassersteinDecomposition(distribution: SecondOrderDistributionLike, num_samples: int = 1000, generator: object | None = None)[source]

Bases: AleatoricEpistemicTotalDecomposition, CachingDecomposition, Generic

Distance-based decomposition of second-order uncertainty [SBCHullermeier24].

The three Wasserstein distance-based measures for a second-order distribution Q (a sample of categorical distributions or a Dirichlet distribution):

  • Total uncertainty: 1 - max_y E_Q[p(y)].

  • Aleatoric uncertainty: 1 - E_Q[max_y p(y)].

  • Epistemic uncertainty: 1/2 min_q E_{p ~ Q}[||p - q||_1].

The measures are defined independently, so the decomposition is not additive (total != aleatoric + epistemic in general), and each lies in [0, (K - 1) / K] for K classes.

Variables:
  • distribution (SecondOrderDistributionLike) – The second-order distribution to decompose.

  • num_samples (int) – Monte-Carlo draws for the aleatoric and epistemic uncertainties of a parametric distribution such as a Dirichlet. Ignored for a sample.

  • generator (object | None) – Optional numpy.random.Generator for reproducible draws (numpy backend only). The torch backend seeds via torch.manual_seed; a generator passed there is ignored with a warning.

property aleatoric: AU

The aleatoric uncertainty of the decomposition.

canonical_notion[source]

alias of TotalUncertainty

property components: list[type[Notion]]

The components of the decomposition.

distribution: SecondOrderDistributionLike
property epistemic: EU

The epistemic uncertainty of the decomposition.

generator: object | None
get(k[, d]) → D[k] if k in D, else d.  d defaults to None.
get_canonical() → Notion[source]

Return the canonical notion of the decomposition.

get_notion(notion: type[N]) → N[source]

Return the component corresponding to the given notion.

items() → a set-like object providing a view on D's items
keys() → a set-like object providing a view on D's keys
num_samples: int
property total: TU

The total uncertainty of the decomposition.

values() → an object providing a view on D's values