whylogs.core.metrics.maths#

Centralized module for core math logic.

These utility functions can be hard to reason about so it’s important to keep them as centralized as possible and close to the original pseudo code.

Module Contents#

Functions#

parallel_variance_m2(→ VarianceM2Result)

Verbatim copy of the parallel variance algorithm from Wikipedia.

welford_online_variance_m2(→ VarianceM2Result)

Attributes#

whylogs.core.metrics.maths.VarianceM2Result#
whylogs.core.metrics.maths.parallel_variance_m2(*, first: VarianceM2Result, second: VarianceM2Result) VarianceM2Result#

Verbatim copy of the parallel variance algorithm from Wikipedia.

Source: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm :param first: the :class:VarianceM2Result object for the first stream :param second: the :class:VarianceM2Result object for the second stream

Returns

The variance result of the overall stream.

Parameters
  • first (VarianceM2Result) –

  • second (VarianceM2Result) –

Return type

VarianceM2Result

whylogs.core.metrics.maths.welford_online_variance_m2(*, existing: VarianceM2Result, new_value: float) VarianceM2Result#
Parameters
  • existing (VarianceM2Result) –

  • new_value (float) –

Return type

VarianceM2Result