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

ml.KMeansModel.transform is very inefficient

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.2
    • 2.2.0
    • ML
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            srowen Sean R. Owen
            FlamingMike Michel Lemay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment