deephyper.ensemble.aggregator.utils.average#
- deephyper.ensemble.aggregator.utils.average(x: ndarray | MaskedArray, axis: int | None = None, weights: Sequence[float] | None = None) ndarray | MaskedArray [source]#
Compute the weighted average of an array, supporting both NumPy arrays and masked arrays.
- Parameters:
- Returns:
Weighted average of the input array.
- Return type:
np.ndarray | np.ma.MaskedArray
- Raises:
TypeError – If x is not a NumPy array or masked array.