lstein.utils.minmaxscale

lstein.utils.minmaxscale(x: ndarray, xmin: float, xmax: float, xmin_ref: float = None, xmax_ref: float = None) ndarray[source]

applies min-max-scaling to x

Parameters
  • x
    • np.ndarray

    • feature to be transformed

  • xmin
    • float

    • lower bound of the target range

  • xmax
    • float

    • upper bound of the target range

  • xmin_ref
    • float, optional

    • lower bound of the original range

    • the default is None
      • will consider x to be representing the original range

      • will be set to np.nanmin(x)

  • xmax_ref
    • float, optional

    • upper bound of the original range

    • the default is None
      • will consider x to be representing the original range

      • will be set to np.nanmax(x)

Raises

Returns
  • x_scaled
    • np.ndarray

    • same shape as x

    • x after the transformation

Dependencies
  • numpy

  • typing