{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/94940511","pull_request_review_id":15483018,"id":94940511,"diff_hunk":"@@ -0,0 +1,138 @@\n+\"\"\"Testing for K-Medoids\"\"\"\n+import numpy as np\n+\n+from sklearn.cluster import KMedoids, KMeans\n+from sklearn.datasets import load_iris\n+from sklearn.exceptions import NotFittedError\n+from sklearn.metrics.pairwise import PAIRWISE_DISTANCE_FUNCTIONS\n+from sklearn.metrics.pairwise import euclidean_distances\n+from sklearn.utils.testing import assert_array_equal\n+from sklearn.utils.testing import assert_equal, assert_raises, \\\n+    assert_raise_message\n+from sklearn.utils.testing import assert_greater\n+\n+rng = np.random.RandomState(0)\n+X = rng.rand(100, 5)\n+\n+\n+def test_kmedoids_input_validation_and_fit_check():\n+    # Invalid parameters\n+    assert_raise_message(ValueError, \"n_clusters should be a nonnegative \"\n+                                     \"integer. 0 was given\",\n+                         KMedoids(n_clusters=0).fit, X)\n+\n+    assert_raise_message(ValueError, \"n_clusters should be a nonnegative \"\n+                                     \"integer. None was given\",\n+                         KMedoids(n_clusters=None).fit, X)\n+\n+    assert_raise_message(ValueError, \"init needs to be one of the following: \"\n+                                     \"['random', 'heuristic']\",\n+                         KMedoids(init=None).fit, X)\n+\n+    # Trying to fit 3 samples to 8 clusters\n+    model = KMedoids(n_clusters=8)","path":"sklearn/cluster/tests/test_k_medoids.py","position":33,"original_position":33,"commit_id":"dee489ad73ab43bc710838654413667c08a28d24","original_commit_id":"dee489ad73ab43bc710838654413667c08a28d24","user":{"login":"raghavrv","id":9487348,"avatar_url":"https://avatars.githubusercontent.com/u/9487348?v=3","gravatar_id":"","url":"https://api.github.com/users/raghavrv","html_url":"https://github.com/raghavrv","followers_url":"https://api.github.com/users/raghavrv/followers","following_url":"https://api.github.com/users/raghavrv/following{/other_user}","gists_url":"https://api.github.com/users/raghavrv/gists{/gist_id}","starred_url":"https://api.github.com/users/raghavrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghavrv/subscriptions","organizations_url":"https://api.github.com/users/raghavrv/orgs","repos_url":"https://api.github.com/users/raghavrv/repos","events_url":"https://api.github.com/users/raghavrv/events{/privacy}","received_events_url":"https://api.github.com/users/raghavrv/received_events","type":"User","site_admin":false},"body":"rm this line and...","created_at":"2017-01-06T12:42:49Z","updated_at":"2017-01-06T12:58:50Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/7694#discussion_r94940511","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/94940511"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/7694#discussion_r94940511"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694","id":89771329,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/7694","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/7694.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/7694.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7694","number":7694,"state":"open","locked":false,"title":"[MRG] Adding K-Medoids clustering algorithm revival","user":{"login":"Kornel","id":628457,"avatar_url":"https://avatars.githubusercontent.com/u/628457?v=3","gravatar_id":"","url":"https://api.github.com/users/Kornel","html_url":"https://github.com/Kornel","followers_url":"https://api.github.com/users/Kornel/followers","following_url":"https://api.github.com/users/Kornel/following{/other_user}","gists_url":"https://api.github.com/users/Kornel/gists{/gist_id}","starred_url":"https://api.github.com/users/Kornel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kornel/subscriptions","organizations_url":"https://api.github.com/users/Kornel/orgs","repos_url":"https://api.github.com/users/Kornel/repos","events_url":"https://api.github.com/users/Kornel/events{/privacy}","received_events_url":"https://api.github.com/users/Kornel/received_events","type":"User","site_admin":false},"body":"This is a revival of https://github.com/scikit-learn/scikit-learn/pull/5085 \nI've rebased the code and fixed the tests.\n","created_at":"2016-10-18T08:49:52Z","updated_at":"2017-01-06T12:58:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48259955fdf5abd6bd28e707441f2b1e46a62d70","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/21","html_url":"https://github.com/scikit-learn/scikit-learn/milestone/21","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/21/labels","id":1970916,"number":21,"title":"0.19","description":"","creator":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"open_issues":170,"closed_issues":61,"state":"open","created_at":"2016-08-29T22:34:33Z","updated_at":"2017-01-05T15:11:19Z","due_on":"2017-04-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7694/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/dee489ad73ab43bc710838654413667c08a28d24","head":{"label":"Kornel:tk-kmedoids","ref":"tk-kmedoids","sha":"dee489ad73ab43bc710838654413667c08a28d24","user":{"login":"Kornel","id":628457,"avatar_url":"https://avatars.githubusercontent.com/u/628457?v=3","gravatar_id":"","url":"https://api.github.com/users/Kornel","html_url":"https://github.com/Kornel","followers_url":"https://api.github.com/users/Kornel/followers","following_url":"https://api.github.com/users/Kornel/following{/other_user}","gists_url":"https://api.github.com/users/Kornel/gists{/gist_id}","starred_url":"https://api.github.com/users/Kornel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kornel/subscriptions","organizations_url":"https://api.github.com/users/Kornel/orgs","repos_url":"https://api.github.com/users/Kornel/repos","events_url":"https://api.github.com/users/Kornel/events{/privacy}","received_events_url":"https://api.github.com/users/Kornel/received_events","type":"User","site_admin":false},"repo":{"id":44137052,"name":"scikit-learn","full_name":"Kornel/scikit-learn","owner":{"login":"Kornel","id":628457,"avatar_url":"https://avatars.githubusercontent.com/u/628457?v=3","gravatar_id":"","url":"https://api.github.com/users/Kornel","html_url":"https://github.com/Kornel","followers_url":"https://api.github.com/users/Kornel/followers","following_url":"https://api.github.com/users/Kornel/following{/other_user}","gists_url":"https://api.github.com/users/Kornel/gists{/gist_id}","starred_url":"https://api.github.com/users/Kornel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kornel/subscriptions","organizations_url":"https://api.github.com/users/Kornel/orgs","repos_url":"https://api.github.com/users/Kornel/repos","events_url":"https://api.github.com/users/Kornel/events{/privacy}","received_events_url":"https://api.github.com/users/Kornel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kornel/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/Kornel/scikit-learn","forks_url":"https://api.github.com/repos/Kornel/scikit-learn/forks","keys_url":"https://api.github.com/repos/Kornel/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kornel/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kornel/scikit-learn/teams","hooks_url":"https://api.github.com/repos/Kornel/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/Kornel/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/Kornel/scikit-learn/events","assignees_url":"https://api.github.com/repos/Kornel/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/Kornel/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/Kornel/scikit-learn/tags","blobs_url":"https://api.github.com/repos/Kornel/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kornel/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kornel/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kornel/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kornel/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/Kornel/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/Kornel/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/Kornel/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/Kornel/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/Kornel/scikit-learn/subscription","commits_url":"https://api.github.com/repos/Kornel/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kornel/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kornel/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kornel/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kornel/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/Kornel/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kornel/scikit-learn/merges","archive_url":"https://api.github.com/repos/Kornel/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kornel/scikit-learn/downloads","issues_url":"https://api.github.com/repos/Kornel/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/Kornel/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/Kornel/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/Kornel/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kornel/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/Kornel/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/Kornel/scikit-learn/deployments","created_at":"2015-10-12T22:13:21Z","updated_at":"2016-01-19T13:45:07Z","pushed_at":"2017-01-05T20:48:10Z","git_url":"git://github.com/Kornel/scikit-learn.git","ssh_url":"git@github.com:Kornel/scikit-learn.git","clone_url":"https://github.com/Kornel/scikit-learn.git","svn_url":"https://github.com/Kornel/scikit-learn","homepage":"http://scikit-learn.org","size":77397,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"scikit-learn:master","ref":"master","sha":"8695ff5969d84429e4a84ee8fea835e52e6d230d","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/deployments","created_at":"2010-08-17T09:43:38Z","updated_at":"2017-01-06T12:14:15Z","pushed_at":"2017-01-06T12:42:32Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":79002,"stargazers_count":15697,"watchers_count":15697,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8788,"mirror_url":null,"open_issues_count":1169,"forks":8788,"open_issues":1169,"watchers":15697,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/7694"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7694"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7694/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/7694/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/dee489ad73ab43bc710838654413667c08a28d24"}}}}
{"actor":{"display_login":"raghavrv"}}