Chalkboard - v3.0.4
    Preparing search index...

    Function normalize

    • Calculates the normalization of an array.

      Parameters

      • arr: number[]

        The array

      • Optionaltype: "L1" | "L2" | "LInfinity" | "L0" = "L2"

        The type of norm to normalize with, which can be "L0", "L1", "L2", or "LInfinity"

      Returns number[]

      const result = Chalkboard.stat.normalize([3, 4]); // Returns [0.6, 0.8]