{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/comments/81395620","pull_request_review_id":2380694,"id":81395620,"diff_hunk":"@@ -43,18 +45,37 @@ function kmeans(X::Matrix, k::Int;\n                 weights=nothing,\n                 init=_kmeans_default_init,\n                 maxiter::Integer=_kmeans_default_maxiter, \n+\t\t\t\tn_init::Integer=_kmeans_default_n_init,\n                 tol::Real=_kmeans_default_tol,\n                 display::Symbol=_kmeans_default_display)\n+\t\t\t\t\n \n     m, n = size(X)\n     (2 <= k < n) || error(\"k must have 2 <= k < n.\")\n-    iseeds = initseeds(init, X, k)\n-    centers = copyseeds(X, iseeds)\n-    kmeans!(X, centers; \n-            weights=weights, \n-            maxiter=maxiter,\n-            tol=tol,\n-            display=display)\n+\tn_init > 0 || error(\"n_init must be greater than 0\")","path":"src/kmeans.jl","position":33,"original_position":33,"commit_id":"775eefcdc25e0f67ceee2f866edc584104cf14d7","original_commit_id":"775eefcdc25e0f67ceee2f866edc584104cf14d7","user":{"login":"ararslan","id":6396159,"avatar_url":"https://avatars.githubusercontent.com/u/6396159?v=3","gravatar_id":"","url":"https://api.github.com/users/ararslan","html_url":"https://github.com/ararslan","followers_url":"https://api.github.com/users/ararslan/followers","following_url":"https://api.github.com/users/ararslan/following{/other_user}","gists_url":"https://api.github.com/users/ararslan/gists{/gist_id}","starred_url":"https://api.github.com/users/ararslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ararslan/subscriptions","organizations_url":"https://api.github.com/users/ararslan/orgs","repos_url":"https://api.github.com/users/ararslan/repos","events_url":"https://api.github.com/users/ararslan/events{/privacy}","received_events_url":"https://api.github.com/users/ararslan/received_events","type":"User","site_admin":false},"body":"Since `n_init` is a function argument, the error should be an `ArgumentError`. You can change this to\r\n```julia\r\nn_init > 0 || throw(ArgumentError(\"n_init must be greater than 0\"))\r\n```","created_at":"2016-09-30T18:41:48Z","updated_at":"2016-09-30T18:41:49Z","html_url":"https://github.com/JuliaStats/Clustering.jl/pull/77#discussion_r81395620","pull_request_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/comments/81395620"},"html":{"href":"https://github.com/JuliaStats/Clustering.jl/pull/77#discussion_r81395620"},"pull_request":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77","id":87542867,"html_url":"https://github.com/JuliaStats/Clustering.jl/pull/77","diff_url":"https://github.com/JuliaStats/Clustering.jl/pull/77.diff","patch_url":"https://github.com/JuliaStats/Clustering.jl/pull/77.patch","issue_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues/77","number":77,"state":"open","locked":false,"title":"Issue #64: added n_init to kmeans","user":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"body":"Implementing n_init feature from sklearn mentioned in [Issue 64](https://github.com/JuliaStats/Clustering.jl/issues/64).\r\n\r\nFirst ever Julia or package commit, please let me know errors or what needs to be cleaned up.","created_at":"2016-09-30T18:28:48Z","updated_at":"2016-09-30T18:41:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3d3a9a2e7231e78600975b462c637eb5ef1cc60","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77/commits","review_comments_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77/comments","review_comment_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues/77/comments","statuses_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/statuses/775eefcdc25e0f67ceee2f866edc584104cf14d7","head":{"label":"lbollar:pull-request/775eefcd","ref":"pull-request/775eefcd","sha":"775eefcdc25e0f67ceee2f866edc584104cf14d7","user":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"repo":{"id":69691008,"name":"Clustering.jl","full_name":"lbollar/Clustering.jl","owner":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lbollar/Clustering.jl","description":"A Julia package for data clustering","fork":true,"url":"https://api.github.com/repos/lbollar/Clustering.jl","forks_url":"https://api.github.com/repos/lbollar/Clustering.jl/forks","keys_url":"https://api.github.com/repos/lbollar/Clustering.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbollar/Clustering.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbollar/Clustering.jl/teams","hooks_url":"https://api.github.com/repos/lbollar/Clustering.jl/hooks","issue_events_url":"https://api.github.com/repos/lbollar/Clustering.jl/issues/events{/number}","events_url":"https://api.github.com/repos/lbollar/Clustering.jl/events","assignees_url":"https://api.github.com/repos/lbollar/Clustering.jl/assignees{/user}","branches_url":"https://api.github.com/repos/lbollar/Clustering.jl/branches{/branch}","tags_url":"https://api.github.com/repos/lbollar/Clustering.jl/tags","blobs_url":"https://api.github.com/repos/lbollar/Clustering.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbollar/Clustering.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbollar/Clustering.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbollar/Clustering.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbollar/Clustering.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/lbollar/Clustering.jl/languages","stargazers_url":"https://api.github.com/repos/lbollar/Clustering.jl/stargazers","contributors_url":"https://api.github.com/repos/lbollar/Clustering.jl/contributors","subscribers_url":"https://api.github.com/repos/lbollar/Clustering.jl/subscribers","subscription_url":"https://api.github.com/repos/lbollar/Clustering.jl/subscription","commits_url":"https://api.github.com/repos/lbollar/Clustering.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbollar/Clustering.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbollar/Clustering.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbollar/Clustering.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbollar/Clustering.jl/contents/{+path}","compare_url":"https://api.github.com/repos/lbollar/Clustering.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbollar/Clustering.jl/merges","archive_url":"https://api.github.com/repos/lbollar/Clustering.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbollar/Clustering.jl/downloads","issues_url":"https://api.github.com/repos/lbollar/Clustering.jl/issues{/number}","pulls_url":"https://api.github.com/repos/lbollar/Clustering.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/lbollar/Clustering.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/lbollar/Clustering.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbollar/Clustering.jl/labels{/name}","releases_url":"https://api.github.com/repos/lbollar/Clustering.jl/releases{/id}","deployments_url":"https://api.github.com/repos/lbollar/Clustering.jl/deployments","created_at":"2016-09-30T18:21:24Z","updated_at":"2016-09-30T18:21:26Z","pushed_at":"2016-09-30T18:21:26Z","git_url":"git://github.com/lbollar/Clustering.jl.git","ssh_url":"git@github.com:lbollar/Clustering.jl.git","clone_url":"https://github.com/lbollar/Clustering.jl.git","svn_url":"https://github.com/lbollar/Clustering.jl","homepage":"","size":536,"stargazers_count":0,"watchers_count":0,"language":"Julia","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":"JuliaStats:master","ref":"master","sha":"ea03689a96f5a4601894959a028b390e9fbf7f73","user":{"login":"JuliaStats","id":2761531,"avatar_url":"https://avatars.githubusercontent.com/u/2761531?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaStats","html_url":"https://github.com/JuliaStats","followers_url":"https://api.github.com/users/JuliaStats/followers","following_url":"https://api.github.com/users/JuliaStats/following{/other_user}","gists_url":"https://api.github.com/users/JuliaStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaStats/subscriptions","organizations_url":"https://api.github.com/users/JuliaStats/orgs","repos_url":"https://api.github.com/users/JuliaStats/repos","events_url":"https://api.github.com/users/JuliaStats/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaStats/received_events","type":"Organization","site_admin":false},"repo":{"id":6841256,"name":"Clustering.jl","full_name":"JuliaStats/Clustering.jl","owner":{"login":"JuliaStats","id":2761531,"avatar_url":"https://avatars.githubusercontent.com/u/2761531?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaStats","html_url":"https://github.com/JuliaStats","followers_url":"https://api.github.com/users/JuliaStats/followers","following_url":"https://api.github.com/users/JuliaStats/following{/other_user}","gists_url":"https://api.github.com/users/JuliaStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaStats/subscriptions","organizations_url":"https://api.github.com/users/JuliaStats/orgs","repos_url":"https://api.github.com/users/JuliaStats/repos","events_url":"https://api.github.com/users/JuliaStats/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaStats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaStats/Clustering.jl","description":"A Julia package for data clustering","fork":false,"url":"https://api.github.com/repos/JuliaStats/Clustering.jl","forks_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/forks","keys_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/teams","hooks_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/events","assignees_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/tags","blobs_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/subscription","commits_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/merges","archive_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/downloads","issues_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaStats/Clustering.jl/deployments","created_at":"2012-11-24T15:47:36Z","updated_at":"2016-09-28T06:23:48Z","pushed_at":"2016-09-30T18:28:48Z","git_url":"git://github.com/JuliaStats/Clustering.jl.git","ssh_url":"git@github.com:JuliaStats/Clustering.jl.git","clone_url":"https://github.com/JuliaStats/Clustering.jl.git","svn_url":"https://github.com/JuliaStats/Clustering.jl","homepage":"","size":536,"stargazers_count":66,"watchers_count":66,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":17,"forks":50,"open_issues":17,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77"},"html":{"href":"https://github.com/JuliaStats/Clustering.jl/pull/77"},"issue":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues/77"},"comments":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaStats/Clustering.jl/statuses/775eefcdc25e0f67ceee2f866edc584104cf14d7"}}}}
{"actor":{"display_login":"ararslan"}}