docstr: Apply exponential moving average over the final axis.
docstr_tok: ["Apply","exponential","moving","average","over","the","final","axis","."]
code: def _exp_moving_avg(arr: np.ndarray, lam: float) -> np.ndarray:
      """Apply exponential moving average over the final axis."""
      output = np.zeros_like(arr)
      output[..., 0] = arr[..., 0]
      for i in range(1, arr.shape[-1]):
          output[..., i] = (1 - lam) * output[..., i - 1] + lam * arr[
              ..., i
          ]
      return output
  
imports: from tqdm import tqdm
  import numpy
  from typing import Any, Callable, List, Optional, Union
  from alibi_detect.base import DriftConfigMixin
  from alibi_detect.cd.base_online import BaseUniDriftOnline
  from alibi_detect.utils.misc import quantile
  from scipy.stats import hypergeom
  import numba
  import warnings
label_desc: Use image node_id 5 for calling the FETDriftOnline obj's underlying member method code with example usage: obj._exp_moving_avg(arr, lam) and returns: output