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

ml.KMeansModel.transform is very inefficient

    Details

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

      Description

      The function ml.KMeansModel.transform will call the parentModel.predict(features) method on each row which in turns will normalize all clusterCenters from mllib.KMeansModel.clusterCentersWithNorm every time!

      This is a serious waste of resources! In my profiling, clusterCentersWithNorm represent 99% of the sampling!

      This should have been implemented with a broadcast variable as it is done in other functions like computeCost.

        Attachments

          Activity

            People

            • Assignee:
              srowen Sean Owen
              Reporter:
              FlamingMike Michel Lemay
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: