{"action":"created","issue":{"url":"https://api.github.com/repos/mlpack/mlpack/issues/388","labels_url":"https://api.github.com/repos/mlpack/mlpack/issues/388/labels{/name}","comments_url":"https://api.github.com/repos/mlpack/mlpack/issues/388/comments","events_url":"https://api.github.com/repos/mlpack/mlpack/issues/388/events","html_url":"https://github.com/mlpack/mlpack/pull/388","id":54684013,"number":388,"title":"Mean shift clustering","user":{"login":"HurricaneTong","id":6715118,"avatar_url":"https://avatars.githubusercontent.com/u/6715118?v=3","gravatar_id":"","url":"https://api.github.com/users/HurricaneTong","html_url":"https://github.com/HurricaneTong","followers_url":"https://api.github.com/users/HurricaneTong/followers","following_url":"https://api.github.com/users/HurricaneTong/following{/other_user}","gists_url":"https://api.github.com/users/HurricaneTong/gists{/gist_id}","starred_url":"https://api.github.com/users/HurricaneTong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HurricaneTong/subscriptions","organizations_url":"https://api.github.com/users/HurricaneTong/orgs","repos_url":"https://api.github.com/users/HurricaneTong/repos","events_url":"https://api.github.com/users/HurricaneTong/events{/privacy}","received_events_url":"https://api.github.com/users/HurricaneTong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-01-18T02:42:05Z","updated_at":"2015-03-27T18:57:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/388","html_url":"https://github.com/mlpack/mlpack/pull/388","diff_url":"https://github.com/mlpack/mlpack/pull/388.diff","patch_url":"https://github.com/mlpack/mlpack/pull/388.patch"},"body":"I implement a basic mean shift algorithm.\r\nI will appreciate it if anyone can give me some guides to make it accepted."},"comment":{"url":"https://api.github.com/repos/mlpack/mlpack/issues/comments/87055142","html_url":"https://github.com/mlpack/mlpack/pull/388#issuecomment-87055142","issue_url":"https://api.github.com/repos/mlpack/mlpack/issues/388","id":87055142,"user":{"login":"rcurtin","id":1845039,"avatar_url":"https://avatars.githubusercontent.com/u/1845039?v=3","gravatar_id":"","url":"https://api.github.com/users/rcurtin","html_url":"https://github.com/rcurtin","followers_url":"https://api.github.com/users/rcurtin/followers","following_url":"https://api.github.com/users/rcurtin/following{/other_user}","gists_url":"https://api.github.com/users/rcurtin/gists{/gist_id}","starred_url":"https://api.github.com/users/rcurtin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcurtin/subscriptions","organizations_url":"https://api.github.com/users/rcurtin/orgs","repos_url":"https://api.github.com/users/rcurtin/repos","events_url":"https://api.github.com/users/rcurtin/events{/privacy}","received_events_url":"https://api.github.com/users/rcurtin/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T18:57:23Z","updated_at":"2015-03-27T18:57:23Z","body":"Okay, I finally had a chance to look through this more thoroughly (my schedule has cleared up a bit, and I can now focus on getting this done).  I went through and made several changes, but it was unclear to me how I might commit to your particular branch, so what I did instead is post my patches to http://www.ratml.org/misc/patches.zip.  You can unzip the patches, then 'git am *.patch' to apply them to your branch.  It's mostly formatting/style cleanups, but there are a few speedups there.\r\n\r\nHowever, what kept me from saying \"okay, we're good to go\" is that the scikit implementation of mean shift is an order of magnitude faster or more.  I used the following test script for scikit:\r\n\r\n```\r\nimport numpy\r\nfrom sklearn.cluster import MeanShift, estimate_bandwidth\r\n\r\nd = numpy.genfromtxt('/path/to/dataset.csv', delimiter=',')\r\nbw = estimate_bandwidth(d, quantile=0.2, n_samples=500)\r\n\r\nprint(bw)\r\n\r\nms = MeanShift(bandwidth=bw, bin_seeding=True)\r\nms.fit(d)\r\n\r\nprint(ms.cluster_centers_)\r\nprint(len(numpy.unique(ms.labels_)))\r\n```\r\n\r\nAnd then I would use the printed bandwidth with the `mean_shift` program.  Could you please look into why the implementation for mlpack is so slow comparatively?"}}