{"action":"created","comment":{"url":"https://api.github.com/repos/OryxProject/oryx/pulls/comments/24867816","id":24867816,"diff_hunk":"@@ -0,0 +1,180 @@\n+/*\n+ * Copyright (c) 2015, Cloudera and Intel, Inc. All Rights Reserved.\n+ *\n+ * Cloudera, Inc. licenses this file to you under the Apache License,\n+ * Version 2.0 (the \"License\"). You may not use this file except in\n+ * compliance with the License. You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * This software is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ * CONDITIONS OF ANY KIND, either express or implied. See the License for\n+ * the specific language governing permissions and limitations under the\n+ * License.\n+ */\n+\n+package com.cloudera.oryx.app.mllib.kmeans;\n+\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+import com.google.common.collect.Lists;\n+import org.dmg.pmml.PMML;\n+import org.junit.Test;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import scala.Tuple2;\n+\n+import com.cloudera.oryx.app.kmeans.ClusterInfo;\n+import com.cloudera.oryx.app.kmeans.DistanceFn;\n+import com.cloudera.oryx.app.kmeans.KMeansPMMLUtils;\n+import com.cloudera.oryx.app.kmeans.SquaredDistanceFn;\n+\n+public class KMeansEvaluationIT extends AbstractKMeansIT {\n+\n+  private final static Logger log = LoggerFactory.getLogger(KMeansEvaluationIT.class);\n+\n+  private static final List<double[]> points =\n+      Arrays.asList(new double[][]{\n+          {1.0, 0.0}, {2.0, -2.0}, {2.0, 0.0},\n+          {-2.0, 0.0}, {-0.5, -1.0}, {-0.5, 1.0}\n+      });\n+\n+  private static List<ClusterInfo> clusters;\n+  private static DistanceFn<double[]> distanceFn = new SquaredDistanceFn();\n+\n+  @Test\n+  public void testEvalClustering() {\n+    for (KMeansEvalStrategy evaluationStrategy : KMeansEvalStrategy.values()) {","path":"oryx-app-mllib/src/test/java/com/cloudera/oryx/app/mllib/kmeans/KMeansEvaluationIT.java","position":51,"original_position":51,"commit_id":"49c6669afec89a5335019bf5a0c336b9e6aa9287","original_commit_id":"49c6669afec89a5335019bf5a0c336b9e6aa9287","user":{"login":"srowen","id":822522,"avatar_url":"https://avatars.githubusercontent.com/u/822522?v=3","gravatar_id":"","url":"https://api.github.com/users/srowen","html_url":"https://github.com/srowen","followers_url":"https://api.github.com/users/srowen/followers","following_url":"https://api.github.com/users/srowen/following{/other_user}","gists_url":"https://api.github.com/users/srowen/gists{/gist_id}","starred_url":"https://api.github.com/users/srowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srowen/subscriptions","organizations_url":"https://api.github.com/users/srowen/orgs","repos_url":"https://api.github.com/users/srowen/repos","events_url":"https://api.github.com/users/srowen/events{/privacy}","received_events_url":"https://api.github.com/users/srowen/received_events","type":"User","site_admin":false},"body":"I think it's simpler to just use JUnit to invoke the methods. You don't need this method at all then.","created_at":"2015-02-17T23:59:23Z","updated_at":"2015-02-17T23:59:23Z","html_url":"https://github.com/OryxProject/oryx/pull/158#discussion_r24867816","pull_request_url":"https://api.github.com/repos/OryxProject/oryx/pulls/158","_links":{"self":{"href":"https://api.github.com/repos/OryxProject/oryx/pulls/comments/24867816"},"html":{"href":"https://github.com/OryxProject/oryx/pull/158#discussion_r24867816"},"pull_request":{"href":"https://api.github.com/repos/OryxProject/oryx/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/OryxProject/oryx/pulls/158","id":29489532,"html_url":"https://github.com/OryxProject/oryx/pull/158","diff_url":"https://github.com/OryxProject/oryx/pull/158.diff","patch_url":"https://github.com/OryxProject/oryx/pull/158.patch","issue_url":"https://api.github.com/repos/OryxProject/oryx/issues/158","number":158,"state":"open","locked":false,"title":"Unit tests for KMean Evaluation criteria","user":{"login":"smarthi","id":3137442,"avatar_url":"https://avatars.githubusercontent.com/u/3137442?v=3","gravatar_id":"","url":"https://api.github.com/users/smarthi","html_url":"https://github.com/smarthi","followers_url":"https://api.github.com/users/smarthi/followers","following_url":"https://api.github.com/users/smarthi/following{/other_user}","gists_url":"https://api.github.com/users/smarthi/gists{/gist_id}","starred_url":"https://api.github.com/users/smarthi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarthi/subscriptions","organizations_url":"https://api.github.com/users/smarthi/orgs","repos_url":"https://api.github.com/users/smarthi/repos","events_url":"https://api.github.com/users/smarthi/events{/privacy}","received_events_url":"https://api.github.com/users/smarthi/received_events","type":"User","site_admin":false},"body":"Fixes #156 ","created_at":"2015-02-17T23:51:49Z","updated_at":"2015-02-17T23:59:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a99520d3b5454b0a1909fb947fa0c7a93a7e67b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OryxProject/oryx/pulls/158/commits","review_comments_url":"https://api.github.com/repos/OryxProject/oryx/pulls/158/comments","review_comment_url":"https://api.github.com/repos/OryxProject/oryx/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OryxProject/oryx/issues/158/comments","statuses_url":"https://api.github.com/repos/OryxProject/oryx/statuses/49c6669afec89a5335019bf5a0c336b9e6aa9287","head":{"label":"smarthi:work","ref":"work","sha":"49c6669afec89a5335019bf5a0c336b9e6aa9287","user":{"login":"smarthi","id":3137442,"avatar_url":"https://avatars.githubusercontent.com/u/3137442?v=3","gravatar_id":"","url":"https://api.github.com/users/smarthi","html_url":"https://github.com/smarthi","followers_url":"https://api.github.com/users/smarthi/followers","following_url":"https://api.github.com/users/smarthi/following{/other_user}","gists_url":"https://api.github.com/users/smarthi/gists{/gist_id}","starred_url":"https://api.github.com/users/smarthi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarthi/subscriptions","organizations_url":"https://api.github.com/users/smarthi/orgs","repos_url":"https://api.github.com/users/smarthi/repos","events_url":"https://api.github.com/users/smarthi/events{/privacy}","received_events_url":"https://api.github.com/users/smarthi/received_events","type":"User","site_admin":false},"repo":{"id":27406313,"name":"oryx","full_name":"smarthi/oryx","owner":{"login":"smarthi","id":3137442,"avatar_url":"https://avatars.githubusercontent.com/u/3137442?v=3","gravatar_id":"","url":"https://api.github.com/users/smarthi","html_url":"https://github.com/smarthi","followers_url":"https://api.github.com/users/smarthi/followers","following_url":"https://api.github.com/users/smarthi/following{/other_user}","gists_url":"https://api.github.com/users/smarthi/gists{/gist_id}","starred_url":"https://api.github.com/users/smarthi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarthi/subscriptions","organizations_url":"https://api.github.com/users/smarthi/orgs","repos_url":"https://api.github.com/users/smarthi/repos","events_url":"https://api.github.com/users/smarthi/events{/privacy}","received_events_url":"https://api.github.com/users/smarthi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smarthi/oryx","description":"Oryx 2 (incubating): Lambda architecture on Spark for real-time large scale machine learning","fork":true,"url":"https://api.github.com/repos/smarthi/oryx","forks_url":"https://api.github.com/repos/smarthi/oryx/forks","keys_url":"https://api.github.com/repos/smarthi/oryx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smarthi/oryx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smarthi/oryx/teams","hooks_url":"https://api.github.com/repos/smarthi/oryx/hooks","issue_events_url":"https://api.github.com/repos/smarthi/oryx/issues/events{/number}","events_url":"https://api.github.com/repos/smarthi/oryx/events","assignees_url":"https://api.github.com/repos/smarthi/oryx/assignees{/user}","branches_url":"https://api.github.com/repos/smarthi/oryx/branches{/branch}","tags_url":"https://api.github.com/repos/smarthi/oryx/tags","blobs_url":"https://api.github.com/repos/smarthi/oryx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smarthi/oryx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smarthi/oryx/git/refs{/sha}","trees_url":"https://api.github.com/repos/smarthi/oryx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smarthi/oryx/statuses/{sha}","languages_url":"https://api.github.com/repos/smarthi/oryx/languages","stargazers_url":"https://api.github.com/repos/smarthi/oryx/stargazers","contributors_url":"https://api.github.com/repos/smarthi/oryx/contributors","subscribers_url":"https://api.github.com/repos/smarthi/oryx/subscribers","subscription_url":"https://api.github.com/repos/smarthi/oryx/subscription","commits_url":"https://api.github.com/repos/smarthi/oryx/commits{/sha}","git_commits_url":"https://api.github.com/repos/smarthi/oryx/git/commits{/sha}","comments_url":"https://api.github.com/repos/smarthi/oryx/comments{/number}","issue_comment_url":"https://api.github.com/repos/smarthi/oryx/issues/comments/{number}","contents_url":"https://api.github.com/repos/smarthi/oryx/contents/{+path}","compare_url":"https://api.github.com/repos/smarthi/oryx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smarthi/oryx/merges","archive_url":"https://api.github.com/repos/smarthi/oryx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smarthi/oryx/downloads","issues_url":"https://api.github.com/repos/smarthi/oryx/issues{/number}","pulls_url":"https://api.github.com/repos/smarthi/oryx/pulls{/number}","milestones_url":"https://api.github.com/repos/smarthi/oryx/milestones{/number}","notifications_url":"https://api.github.com/repos/smarthi/oryx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smarthi/oryx/labels{/name}","releases_url":"https://api.github.com/repos/smarthi/oryx/releases{/id}","created_at":"2014-12-01T23:58:19Z","updated_at":"2015-02-17T23:48:03Z","pushed_at":"2015-02-17T23:51:19Z","git_url":"git://github.com/smarthi/oryx.git","ssh_url":"git@github.com:smarthi/oryx.git","clone_url":"https://github.com/smarthi/oryx.git","svn_url":"https://github.com/smarthi/oryx","homepage":null,"size":3124,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OryxProject:master","ref":"master","sha":"bbe55443f18d807e00bcbe4f8117b5655feb2137","user":{"login":"OryxProject","id":8270649,"avatar_url":"https://avatars.githubusercontent.com/u/8270649?v=3","gravatar_id":"","url":"https://api.github.com/users/OryxProject","html_url":"https://github.com/OryxProject","followers_url":"https://api.github.com/users/OryxProject/followers","following_url":"https://api.github.com/users/OryxProject/following{/other_user}","gists_url":"https://api.github.com/users/OryxProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OryxProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OryxProject/subscriptions","organizations_url":"https://api.github.com/users/OryxProject/orgs","repos_url":"https://api.github.com/users/OryxProject/repos","events_url":"https://api.github.com/users/OryxProject/events{/privacy}","received_events_url":"https://api.github.com/users/OryxProject/received_events","type":"Organization","site_admin":false},"repo":{"id":22269384,"name":"oryx","full_name":"OryxProject/oryx","owner":{"login":"OryxProject","id":8270649,"avatar_url":"https://avatars.githubusercontent.com/u/8270649?v=3","gravatar_id":"","url":"https://api.github.com/users/OryxProject","html_url":"https://github.com/OryxProject","followers_url":"https://api.github.com/users/OryxProject/followers","following_url":"https://api.github.com/users/OryxProject/following{/other_user}","gists_url":"https://api.github.com/users/OryxProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OryxProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OryxProject/subscriptions","organizations_url":"https://api.github.com/users/OryxProject/orgs","repos_url":"https://api.github.com/users/OryxProject/repos","events_url":"https://api.github.com/users/OryxProject/events{/privacy}","received_events_url":"https://api.github.com/users/OryxProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OryxProject/oryx","description":"Oryx 2 (incubating): Lambda architecture on Spark for real-time large scale machine learning","fork":false,"url":"https://api.github.com/repos/OryxProject/oryx","forks_url":"https://api.github.com/repos/OryxProject/oryx/forks","keys_url":"https://api.github.com/repos/OryxProject/oryx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OryxProject/oryx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OryxProject/oryx/teams","hooks_url":"https://api.github.com/repos/OryxProject/oryx/hooks","issue_events_url":"https://api.github.com/repos/OryxProject/oryx/issues/events{/number}","events_url":"https://api.github.com/repos/OryxProject/oryx/events","assignees_url":"https://api.github.com/repos/OryxProject/oryx/assignees{/user}","branches_url":"https://api.github.com/repos/OryxProject/oryx/branches{/branch}","tags_url":"https://api.github.com/repos/OryxProject/oryx/tags","blobs_url":"https://api.github.com/repos/OryxProject/oryx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OryxProject/oryx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OryxProject/oryx/git/refs{/sha}","trees_url":"https://api.github.com/repos/OryxProject/oryx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OryxProject/oryx/statuses/{sha}","languages_url":"https://api.github.com/repos/OryxProject/oryx/languages","stargazers_url":"https://api.github.com/repos/OryxProject/oryx/stargazers","contributors_url":"https://api.github.com/repos/OryxProject/oryx/contributors","subscribers_url":"https://api.github.com/repos/OryxProject/oryx/subscribers","subscription_url":"https://api.github.com/repos/OryxProject/oryx/subscription","commits_url":"https://api.github.com/repos/OryxProject/oryx/commits{/sha}","git_commits_url":"https://api.github.com/repos/OryxProject/oryx/git/commits{/sha}","comments_url":"https://api.github.com/repos/OryxProject/oryx/comments{/number}","issue_comment_url":"https://api.github.com/repos/OryxProject/oryx/issues/comments/{number}","contents_url":"https://api.github.com/repos/OryxProject/oryx/contents/{+path}","compare_url":"https://api.github.com/repos/OryxProject/oryx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OryxProject/oryx/merges","archive_url":"https://api.github.com/repos/OryxProject/oryx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OryxProject/oryx/downloads","issues_url":"https://api.github.com/repos/OryxProject/oryx/issues{/number}","pulls_url":"https://api.github.com/repos/OryxProject/oryx/pulls{/number}","milestones_url":"https://api.github.com/repos/OryxProject/oryx/milestones{/number}","notifications_url":"https://api.github.com/repos/OryxProject/oryx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OryxProject/oryx/labels{/name}","releases_url":"https://api.github.com/repos/OryxProject/oryx/releases{/id}","created_at":"2014-07-25T20:08:44Z","updated_at":"2015-02-17T23:44:15Z","pushed_at":"2015-02-17T23:44:15Z","git_url":"git://github.com/OryxProject/oryx.git","ssh_url":"git@github.com:OryxProject/oryx.git","clone_url":"https://github.com/OryxProject/oryx.git","svn_url":"https://github.com/OryxProject/oryx","homepage":null,"size":5553,"stargazers_count":231,"watchers_count":231,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"open_issues_count":8,"forks":45,"open_issues":8,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OryxProject/oryx/pulls/158"},"html":{"href":"https://github.com/OryxProject/oryx/pull/158"},"issue":{"href":"https://api.github.com/repos/OryxProject/oryx/issues/158"},"comments":{"href":"https://api.github.com/repos/OryxProject/oryx/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/OryxProject/oryx/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/OryxProject/oryx/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OryxProject/oryx/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/OryxProject/oryx/statuses/49c6669afec89a5335019bf5a0c336b9e6aa9287"}}}}