{"action":"created","comment":{"url":"https://api.github.com/repos/apache/mahout/pulls/comments/93155654","pull_request_review_id":13677474,"id":93155654,"diff_hunk":"@@ -141,6 +144,42 @@ package object sparkbindings {\n     new CheckpointedDrmSpark[K](rddInput = rdd, _nrow = nrow, _ncol = ncol, cacheHint = cacheHint,\n       _canHaveMissingRows = canHaveMissingRows)\n \n+  /** A drmWrap version that takes an RDD[org.apache.spark.mllib.regression.LabeledPoint]\n+    * returns a DRM where column 0 is the label */\n+  def drmWrapMLLibLabeledPoint(rdd: RDD[LabeledPoint],\n+                   nrow: Long = -1,\n+                   ncol: Int = -1,\n+                   cacheHint: CacheHint.CacheHint = CacheHint.NONE,\n+                   canHaveMissingRows: Boolean = false): CheckpointedDrm[Int] = {\n+    val drmRDD: DrmRdd[Int] = rdd.zipWithIndex.map( lv => (lv._2.toInt,\n+      new org.apache.mahout.math.DenseVector( Array(lv._1.label) ++ lv._1.features.toArray)) )","path":"spark/src/main/scala/org/apache/mahout/sparkbindings/package.scala","position":29,"original_position":29,"commit_id":"50cce23ef99f8fbff4eabbbf2134356ac14a561b","original_commit_id":"50cce23ef99f8fbff4eabbbf2134356ac14a561b","user":{"login":"andrewpalumbo","id":7681565,"avatar_url":"https://avatars.githubusercontent.com/u/7681565?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewpalumbo","html_url":"https://github.com/andrewpalumbo","followers_url":"https://api.github.com/users/andrewpalumbo/followers","following_url":"https://api.github.com/users/andrewpalumbo/following{/other_user}","gists_url":"https://api.github.com/users/andrewpalumbo/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewpalumbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewpalumbo/subscriptions","organizations_url":"https://api.github.com/users/andrewpalumbo/orgs","repos_url":"https://api.github.com/users/andrewpalumbo/repos","events_url":"https://api.github.com/users/andrewpalumbo/events{/privacy}","received_events_url":"https://api.github.com/users/andrewpalumbo/received_events","type":"User","site_admin":false},"body":"I don't think that this should always be dense\r\n","created_at":"2016-12-20T01:23:02Z","updated_at":"2016-12-20T01:36:07Z","html_url":"https://github.com/apache/mahout/pull/263#discussion_r93155654","pull_request_url":"https://api.github.com/repos/apache/mahout/pulls/263","_links":{"self":{"href":"https://api.github.com/repos/apache/mahout/pulls/comments/93155654"},"html":{"href":"https://github.com/apache/mahout/pull/263#discussion_r93155654"},"pull_request":{"href":"https://api.github.com/repos/apache/mahout/pulls/263"}}},"pull_request":{"url":"https://api.github.com/repos/apache/mahout/pulls/263","id":98249249,"html_url":"https://github.com/apache/mahout/pull/263","diff_url":"https://github.com/apache/mahout/pull/263.diff","patch_url":"https://github.com/apache/mahout/pull/263.patch","issue_url":"https://api.github.com/repos/apache/mahout/issues/263","number":263,"state":"open","locked":false,"title":"[MAHOUT-1896] Add convenience methods for interacting with Spark ML","user":{"login":"rawkintrevo","id":5852441,"avatar_url":"https://avatars.githubusercontent.com/u/5852441?v=3","gravatar_id":"","url":"https://api.github.com/users/rawkintrevo","html_url":"https://github.com/rawkintrevo","followers_url":"https://api.github.com/users/rawkintrevo/followers","following_url":"https://api.github.com/users/rawkintrevo/following{/other_user}","gists_url":"https://api.github.com/users/rawkintrevo/gists{/gist_id}","starred_url":"https://api.github.com/users/rawkintrevo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawkintrevo/subscriptions","organizations_url":"https://api.github.com/users/rawkintrevo/orgs","repos_url":"https://api.github.com/users/rawkintrevo/repos","events_url":"https://api.github.com/users/rawkintrevo/events{/privacy}","received_events_url":"https://api.github.com/users/rawkintrevo/received_events","type":"User","site_admin":false},"body":"Currently the method for ingesting RDDs to DRM is `drmWrap`. This is a flexible method, however there are many cases when the RDD to be wrapped is either RDD[org.apache.spark.mllib.lingalg.Vector], RDD[org.apache.spark.mllib.regression.LabeledPoint], or DataFrame[Row] (as is the case when working with SparkML. It makes sense to create convenience methods for converting these types to DRM.\r\n\r\n* [x] Add `drmWrapMLLibLabeledPoint`\r\n* [x] Add `drmWrapDataFrame`\r\n* [x] Add `drmWrapMLLibVector`\r\n* [x] Tests\r\n\r\n\r\nMinor improvement\r\n\r\n[Relevent JIRA MAHOUT-1896](https://issues.apache.org/jira/browse/MAHOUT-1896)\r\n\r\nRequires no license updates","created_at":"2016-12-15T23:06:57Z","updated_at":"2016-12-20T01:36:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eca845e25da29834e3a84a13f1b07d63cb48c065","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/mahout/pulls/263/commits","review_comments_url":"https://api.github.com/repos/apache/mahout/pulls/263/comments","review_comment_url":"https://api.github.com/repos/apache/mahout/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/mahout/issues/263/comments","statuses_url":"https://api.github.com/repos/apache/mahout/statuses/50cce23ef99f8fbff4eabbbf2134356ac14a561b","head":{"label":"rawkintrevo:mahout-1896","ref":"mahout-1896","sha":"50cce23ef99f8fbff4eabbbf2134356ac14a561b","user":{"login":"rawkintrevo","id":5852441,"avatar_url":"https://avatars.githubusercontent.com/u/5852441?v=3","gravatar_id":"","url":"https://api.github.com/users/rawkintrevo","html_url":"https://github.com/rawkintrevo","followers_url":"https://api.github.com/users/rawkintrevo/followers","following_url":"https://api.github.com/users/rawkintrevo/following{/other_user}","gists_url":"https://api.github.com/users/rawkintrevo/gists{/gist_id}","starred_url":"https://api.github.com/users/rawkintrevo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawkintrevo/subscriptions","organizations_url":"https://api.github.com/users/rawkintrevo/orgs","repos_url":"https://api.github.com/users/rawkintrevo/repos","events_url":"https://api.github.com/users/rawkintrevo/events{/privacy}","received_events_url":"https://api.github.com/users/rawkintrevo/received_events","type":"User","site_admin":false},"repo":{"id":58957306,"name":"mahout","full_name":"rawkintrevo/mahout","owner":{"login":"rawkintrevo","id":5852441,"avatar_url":"https://avatars.githubusercontent.com/u/5852441?v=3","gravatar_id":"","url":"https://api.github.com/users/rawkintrevo","html_url":"https://github.com/rawkintrevo","followers_url":"https://api.github.com/users/rawkintrevo/followers","following_url":"https://api.github.com/users/rawkintrevo/following{/other_user}","gists_url":"https://api.github.com/users/rawkintrevo/gists{/gist_id}","starred_url":"https://api.github.com/users/rawkintrevo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawkintrevo/subscriptions","organizations_url":"https://api.github.com/users/rawkintrevo/orgs","repos_url":"https://api.github.com/users/rawkintrevo/repos","events_url":"https://api.github.com/users/rawkintrevo/events{/privacy}","received_events_url":"https://api.github.com/users/rawkintrevo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rawkintrevo/mahout","description":"Mirror of Apache Mahout","fork":true,"url":"https://api.github.com/repos/rawkintrevo/mahout","forks_url":"https://api.github.com/repos/rawkintrevo/mahout/forks","keys_url":"https://api.github.com/repos/rawkintrevo/mahout/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rawkintrevo/mahout/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rawkintrevo/mahout/teams","hooks_url":"https://api.github.com/repos/rawkintrevo/mahout/hooks","issue_events_url":"https://api.github.com/repos/rawkintrevo/mahout/issues/events{/number}","events_url":"https://api.github.com/repos/rawkintrevo/mahout/events","assignees_url":"https://api.github.com/repos/rawkintrevo/mahout/assignees{/user}","branches_url":"https://api.github.com/repos/rawkintrevo/mahout/branches{/branch}","tags_url":"https://api.github.com/repos/rawkintrevo/mahout/tags","blobs_url":"https://api.github.com/repos/rawkintrevo/mahout/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rawkintrevo/mahout/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rawkintrevo/mahout/git/refs{/sha}","trees_url":"https://api.github.com/repos/rawkintrevo/mahout/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rawkintrevo/mahout/statuses/{sha}","languages_url":"https://api.github.com/repos/rawkintrevo/mahout/languages","stargazers_url":"https://api.github.com/repos/rawkintrevo/mahout/stargazers","contributors_url":"https://api.github.com/repos/rawkintrevo/mahout/contributors","subscribers_url":"https://api.github.com/repos/rawkintrevo/mahout/subscribers","subscription_url":"https://api.github.com/repos/rawkintrevo/mahout/subscription","commits_url":"https://api.github.com/repos/rawkintrevo/mahout/commits{/sha}","git_commits_url":"https://api.github.com/repos/rawkintrevo/mahout/git/commits{/sha}","comments_url":"https://api.github.com/repos/rawkintrevo/mahout/comments{/number}","issue_comment_url":"https://api.github.com/repos/rawkintrevo/mahout/issues/comments{/number}","contents_url":"https://api.github.com/repos/rawkintrevo/mahout/contents/{+path}","compare_url":"https://api.github.com/repos/rawkintrevo/mahout/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rawkintrevo/mahout/merges","archive_url":"https://api.github.com/repos/rawkintrevo/mahout/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rawkintrevo/mahout/downloads","issues_url":"https://api.github.com/repos/rawkintrevo/mahout/issues{/number}","pulls_url":"https://api.github.com/repos/rawkintrevo/mahout/pulls{/number}","milestones_url":"https://api.github.com/repos/rawkintrevo/mahout/milestones{/number}","notifications_url":"https://api.github.com/repos/rawkintrevo/mahout/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rawkintrevo/mahout/labels{/name}","releases_url":"https://api.github.com/repos/rawkintrevo/mahout/releases{/id}","deployments_url":"https://api.github.com/repos/rawkintrevo/mahout/deployments","created_at":"2016-05-16T18:35:48Z","updated_at":"2016-05-16T18:35:55Z","pushed_at":"2016-12-19T15:10:59Z","git_url":"git://github.com/rawkintrevo/mahout.git","ssh_url":"git@github.com:rawkintrevo/mahout.git","clone_url":"https://github.com/rawkintrevo/mahout.git","svn_url":"https://github.com/rawkintrevo/mahout","homepage":null,"size":49297,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"00a2883ec69b0807a5486c61dfcc7ef27f35ddc6","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":20089859,"name":"mahout","full_name":"apache/mahout","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/mahout","description":"Mirror of Apache Mahout","fork":false,"url":"https://api.github.com/repos/apache/mahout","forks_url":"https://api.github.com/repos/apache/mahout/forks","keys_url":"https://api.github.com/repos/apache/mahout/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/mahout/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/mahout/teams","hooks_url":"https://api.github.com/repos/apache/mahout/hooks","issue_events_url":"https://api.github.com/repos/apache/mahout/issues/events{/number}","events_url":"https://api.github.com/repos/apache/mahout/events","assignees_url":"https://api.github.com/repos/apache/mahout/assignees{/user}","branches_url":"https://api.github.com/repos/apache/mahout/branches{/branch}","tags_url":"https://api.github.com/repos/apache/mahout/tags","blobs_url":"https://api.github.com/repos/apache/mahout/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/mahout/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/mahout/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/mahout/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/mahout/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/mahout/languages","stargazers_url":"https://api.github.com/repos/apache/mahout/stargazers","contributors_url":"https://api.github.com/repos/apache/mahout/contributors","subscribers_url":"https://api.github.com/repos/apache/mahout/subscribers","subscription_url":"https://api.github.com/repos/apache/mahout/subscription","commits_url":"https://api.github.com/repos/apache/mahout/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/mahout/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/mahout/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/mahout/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/mahout/contents/{+path}","compare_url":"https://api.github.com/repos/apache/mahout/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/mahout/merges","archive_url":"https://api.github.com/repos/apache/mahout/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/mahout/downloads","issues_url":"https://api.github.com/repos/apache/mahout/issues{/number}","pulls_url":"https://api.github.com/repos/apache/mahout/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/mahout/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/mahout/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/mahout/labels{/name}","releases_url":"https://api.github.com/repos/apache/mahout/releases{/id}","deployments_url":"https://api.github.com/repos/apache/mahout/deployments","created_at":"2014-05-23T07:00:07Z","updated_at":"2016-12-19T16:59:32Z","pushed_at":"2016-12-19T15:11:01Z","git_url":"git://github.com/apache/mahout.git","ssh_url":"git@github.com:apache/mahout.git","clone_url":"https://github.com/apache/mahout.git","svn_url":"https://github.com/apache/mahout","homepage":null,"size":52345,"stargazers_count":990,"watchers_count":990,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":710,"mirror_url":"git://git.apache.org/mahout.git","open_issues_count":17,"forks":710,"open_issues":17,"watchers":990,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/mahout/pulls/263"},"html":{"href":"https://github.com/apache/mahout/pull/263"},"issue":{"href":"https://api.github.com/repos/apache/mahout/issues/263"},"comments":{"href":"https://api.github.com/repos/apache/mahout/issues/263/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/mahout/pulls/263/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/mahout/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/mahout/pulls/263/commits"},"statuses":{"href":"https://api.github.com/repos/apache/mahout/statuses/50cce23ef99f8fbff4eabbbf2134356ac14a561b"}}}}
{"actor":{"display_login":"andrewpalumbo"}}