{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/47078991","id":47078991,"diff_hunk":"@@ -176,6 +176,21 @@ class KMeans @Since(\"1.5.0\") (\n   @Since(\"1.5.0\")\n   def setSeed(value: Long): this.type = set(seed, value)\n \n+  // Initial cluster centers can be provided as a KMeansModel object rather than using the\n+  // random or k-means|| initializationMode\n+  private var initialModel: Option[MLlibKMeansModel] = None\n+\n+  /**\n+   * Set the initial starting point, bypassing the random initialization or k-means||\n+   * The condition model.k == this.k must be met, failure results\n+   * in an IllegalArgumentException.\n+   */\n+  def setInitialModel(model: MLlibKMeansModel): this.type = {","path":"mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala","position":13,"original_position":13,"commit_id":"d92c143665679537ff753e17f4f16f552e433f81","original_commit_id":"d92c143665679537ff753e17f4f16f552e433f81","user":{"login":"yanboliang","id":1962026,"avatar_url":"https://avatars.githubusercontent.com/u/1962026?v=3","gravatar_id":"","url":"https://api.github.com/users/yanboliang","html_url":"https://github.com/yanboliang","followers_url":"https://api.github.com/users/yanboliang/followers","following_url":"https://api.github.com/users/yanboliang/following{/other_user}","gists_url":"https://api.github.com/users/yanboliang/gists{/gist_id}","starred_url":"https://api.github.com/users/yanboliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanboliang/subscriptions","organizations_url":"https://api.github.com/users/yanboliang/orgs","repos_url":"https://api.github.com/users/yanboliang/repos","events_url":"https://api.github.com/users/yanboliang/events{/privacy}","received_events_url":"https://api.github.com/users/yanboliang/received_events","type":"User","site_admin":false},"body":"+1 @dbtsai ","created_at":"2015-12-09T11:26:11Z","updated_at":"2015-12-09T11:26:11Z","html_url":"https://github.com/apache/spark/pull/8972#discussion_r47078991","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/8972","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/47078991"},"html":{"href":"https://github.com/apache/spark/pull/8972#discussion_r47078991"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/8972"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/8972","id":46703377,"html_url":"https://github.com/apache/spark/pull/8972","diff_url":"https://github.com/apache/spark/pull/8972.diff","patch_url":"https://github.com/apache/spark/pull/8972.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/8972","number":8972,"state":"open","locked":false,"title":"[SPARK-10780] [ML]  Set initialModel in KMeans in Pipelines API","user":{"login":"jayantshekhar","id":1664088,"avatar_url":"https://avatars.githubusercontent.com/u/1664088?v=3","gravatar_id":"","url":"https://api.github.com/users/jayantshekhar","html_url":"https://github.com/jayantshekhar","followers_url":"https://api.github.com/users/jayantshekhar/followers","following_url":"https://api.github.com/users/jayantshekhar/following{/other_user}","gists_url":"https://api.github.com/users/jayantshekhar/gists{/gist_id}","starred_url":"https://api.github.com/users/jayantshekhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayantshekhar/subscriptions","organizations_url":"https://api.github.com/users/jayantshekhar/orgs","repos_url":"https://api.github.com/users/jayantshekhar/repos","events_url":"https://api.github.com/users/jayantshekhar/events{/privacy}","received_events_url":"https://api.github.com/users/jayantshekhar/received_events","type":"User","site_admin":false},"body":"Added private var initialModel: Option[MLlibKMeansModel] = None to KMeans.scala to support the functionality.\r\n\r\nHoping that is the right place for it. Adding to KMeansParams would probably not be right. It would be great to get inputs.","created_at":"2015-10-03T10:24:35Z","updated_at":"2015-12-09T11:26:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25c508bfd8a67592295b0f76260258d702307a3f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/8972/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/8972/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/8972/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/d92c143665679537ff753e17f4f16f552e433f81","head":{"label":"jayantwork:SPARK-10780","ref":"SPARK-10780","sha":"d92c143665679537ff753e17f4f16f552e433f81","user":{"login":"jayantwork","id":14952181,"avatar_url":"https://avatars.githubusercontent.com/u/14952181?v=3","gravatar_id":"","url":"https://api.github.com/users/jayantwork","html_url":"https://github.com/jayantwork","followers_url":"https://api.github.com/users/jayantwork/followers","following_url":"https://api.github.com/users/jayantwork/following{/other_user}","gists_url":"https://api.github.com/users/jayantwork/gists{/gist_id}","starred_url":"https://api.github.com/users/jayantwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayantwork/subscriptions","organizations_url":"https://api.github.com/users/jayantwork/orgs","repos_url":"https://api.github.com/users/jayantwork/repos","events_url":"https://api.github.com/users/jayantwork/events{/privacy}","received_events_url":"https://api.github.com/users/jayantwork/received_events","type":"Organization","site_admin":false},"repo":{"id":43595168,"name":"spark","full_name":"jayantwork/spark","owner":{"login":"jayantwork","id":14952181,"avatar_url":"https://avatars.githubusercontent.com/u/14952181?v=3","gravatar_id":"","url":"https://api.github.com/users/jayantwork","html_url":"https://github.com/jayantwork","followers_url":"https://api.github.com/users/jayantwork/followers","following_url":"https://api.github.com/users/jayantwork/following{/other_user}","gists_url":"https://api.github.com/users/jayantwork/gists{/gist_id}","starred_url":"https://api.github.com/users/jayantwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayantwork/subscriptions","organizations_url":"https://api.github.com/users/jayantwork/orgs","repos_url":"https://api.github.com/users/jayantwork/repos","events_url":"https://api.github.com/users/jayantwork/events{/privacy}","received_events_url":"https://api.github.com/users/jayantwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jayantwork/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/jayantwork/spark","forks_url":"https://api.github.com/repos/jayantwork/spark/forks","keys_url":"https://api.github.com/repos/jayantwork/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jayantwork/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jayantwork/spark/teams","hooks_url":"https://api.github.com/repos/jayantwork/spark/hooks","issue_events_url":"https://api.github.com/repos/jayantwork/spark/issues/events{/number}","events_url":"https://api.github.com/repos/jayantwork/spark/events","assignees_url":"https://api.github.com/repos/jayantwork/spark/assignees{/user}","branches_url":"https://api.github.com/repos/jayantwork/spark/branches{/branch}","tags_url":"https://api.github.com/repos/jayantwork/spark/tags","blobs_url":"https://api.github.com/repos/jayantwork/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jayantwork/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jayantwork/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/jayantwork/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jayantwork/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/jayantwork/spark/languages","stargazers_url":"https://api.github.com/repos/jayantwork/spark/stargazers","contributors_url":"https://api.github.com/repos/jayantwork/spark/contributors","subscribers_url":"https://api.github.com/repos/jayantwork/spark/subscribers","subscription_url":"https://api.github.com/repos/jayantwork/spark/subscription","commits_url":"https://api.github.com/repos/jayantwork/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/jayantwork/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/jayantwork/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/jayantwork/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/jayantwork/spark/contents/{+path}","compare_url":"https://api.github.com/repos/jayantwork/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jayantwork/spark/merges","archive_url":"https://api.github.com/repos/jayantwork/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jayantwork/spark/downloads","issues_url":"https://api.github.com/repos/jayantwork/spark/issues{/number}","pulls_url":"https://api.github.com/repos/jayantwork/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/jayantwork/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/jayantwork/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jayantwork/spark/labels{/name}","releases_url":"https://api.github.com/repos/jayantwork/spark/releases{/id}","created_at":"2015-10-03T10:12:44Z","updated_at":"2015-10-03T10:13:15Z","pushed_at":"2015-12-08T23:50:28Z","git_url":"git://github.com/jayantwork/spark.git","ssh_url":"git@github.com:jayantwork/spark.git","clone_url":"https://github.com/jayantwork/spark.git","svn_url":"https://github.com/jayantwork/spark","homepage":null,"size":138046,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"107320c9bbfe2496963a4e75e60fd6ba7fbfbabc","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-12-09T11:20:02Z","pushed_at":"2015-12-09T10:09:31Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":389842,"stargazers_count":6512,"watchers_count":6512,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6027,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":412,"forks":6027,"open_issues":412,"watchers":6512,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/8972"},"html":{"href":"https://github.com/apache/spark/pull/8972"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/8972"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/8972/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/8972/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/8972/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/d92c143665679537ff753e17f4f16f552e433f81"}}}}