Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-28499

Optimize MinMaxScaler

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: ML
    • Labels:
      None

      Description

      current impl of MinMaxScaler has some small places to be optimized:

      1, avoid call param getter in udf.

      If I remember correctly, there was some tickets and prs about this, calling param getter in udf or map function, will significantly slow down the computation.

      2, for a constant dim, the transformed value is also a constant value, which can be precomputed.

      3, for a usual dim (i-th), the value is update by

      values = (values - minArray) / range * scale + $(min)

      here, we can precompute  scale / range, so that a division can be skipped.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                podongfeng zhengruifeng
                Reporter:
                podongfeng zhengruifeng
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: