baybe.utils.numerical.geom_mean

baybe.utils.numerical.geom_mean(arr: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], weights: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])[source]

Calculate the (weighted) geometric mean along the second axis of a 2-D array.

Alternative to gmean from scipy that avoids logarithms and division errors.

Parameters:
Return type:

ndarray

Returns:

A 1-D array containing the row-wise geometric means of the given array.