Re: [Scikit-learn-general] K means on a sphere

2013-01-31 Thread Ariel Rokem
27;s working for me. >>>>> >>>>> Thanks again, >>>>> >>>>> Ariel >>>>> >>>>> >>>>> On Thu, Jan 24, 2013 at 5:35 AM, Bertrand Thirion < >>>>> bertrand.thir...@inria.fr> wrote:

Re: [Scikit-learn-general] K means on a sphere

2013-01-31 Thread Ariel Rokem
Hi Denis, On Thu, Jan 31, 2013 at 8:48 AM, denis wrote: > Ariel, > what's k, how many data points do you have ? > I have something between approximately 2 and 150 data points. What's k? I guess that's my next question, right? For now, I am trying to use an AIC criterion to determine how hig

Re: [Scikit-learn-general] K means on a sphere

2013-01-31 Thread denis
Ariel, what's k, how many data points do you have ? There's a trivial k-means under http://stackoverflow.com/questions/5529625/is-it-possible-to-specify-your-own-distance-function-using-scikits-learn-k-means "verbose=1" gives you some idea of how clusters converge (or not). (If you have even a

Re: [Scikit-learn-general] K means on a sphere

2013-01-28 Thread Wei LI
by minimizing the sum of squared distances to a given set of points within >>>>> each cluster. However, it is true that re-projecting the euclidean mean >>>>> to >>>>> the sphere would approximate well the theoretical solution in most cases. >>&g

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Satrajit Ghosh
t;> by minimizing the sum of squared distances to a given set of points within >>>> each cluster. However, it is true that re-projecting the euclidean mean to >>>> the sphere would approximate well the theoretical solution in most cases. >>>> >>>> A standard alternative

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Ariel Rokem
andard alternative to k-means is Von Mises-Fisher distribution. >>> >>> Bertrand >>> >>> -- >>> >>> *De: *"Vince Fernando" >>> *À: *math...@mblondel.org, scikit-learn-general@lists.sourceforge.net

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Satrajit Ghosh
gt;> Bertrand >> >> -- >> >> *De: *"Vince Fernando" >> *À: *math...@mblondel.org, scikit-learn-general@lists.sourceforge.net >> *Envoyé: *Jeudi 24 Janvier 2013 09:55:46 >> *Objet: *Re: [Scikit-learn-general] K mean

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Ariel Rokem
; > -- > > *De: *"Vince Fernando" > *À: *math...@mblondel.org, scikit-learn-general@lists.sourceforge.net > *Envoyé: *Jeudi 24 Janvier 2013 09:55:46 > *Objet: *Re: [Scikit-learn-general] K means on a sphere > > > Are there any theoretica

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Bertrand Thirion
. A standard alternative to k-means is Von Mises-Fisher distribution. Bertrand - Mail original - > De: "Vince Fernando" > À: math...@mblondel.org, scikit-learn-general@lists.sourceforge.net > Envoyé: Jeudi 24 Janvier 2013 09:55:46 > Objet: Re: [Scikit-learn-genera

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Stéfan van der Walt
On Jan 24, 2013 5:35 PM, "Charles-Pierre Astolfi" wrote: > > There's no projection that conserves the distance wrt to any pair of > points on the sphere (although there are some that conserves the > distance wrt 1 or 2 specific points on the sphere) > > BUT the gnomonic project conserves the short

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Charles-Pierre Astolfi
I'm a noob when it comes to data on a sphere, but is there any issue with preprocessing the data to project it on a place, run kmeans in the plane and the reproject it back on the sphere? There's no projection that conserves the distance wrt to any pair of points on the sphere (although there are

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Alexandre Gramfort
hi Ariel, what I would do first, if the data are not too big, is reimplement my kmeans in 10 lines and after you update the centers, normalize them to put them back on the sphere. I don't think you can say much about convergence but it might work well enough in practice. HTH Alex On Thu, Jan 24,

Re: [Scikit-learn-general] K means on a sphere

2013-01-24 Thread Vince Fernando
Are there any theoretical problems if one uses the great circle (orthodromic) distance on a sphere in k-means or any other clustering algorithm? vince On 24 January 2013 07:11, Mathieu Blondel wrote: > On Thu, Jan 24, 2013 at 9:24 AM, Gael Varoquaux > wrote: > > > Yes, there is a massive diffe

Re: [Scikit-learn-general] K means on a sphere

2013-01-23 Thread Mathieu Blondel
On Thu, Jan 24, 2013 at 9:24 AM, Gael Varoquaux wrote: > Yes, there is a massive difference in amount of work and performance when > you try to replace the Euclidean distance. Amongst other problems, the > mean is no longer the sum divided by the number of points, but the > Frechet mean, which re

Re: [Scikit-learn-general] K means on a sphere

2013-01-23 Thread Alexandre Gramfort
hi Ariel, what I would do, if the data are not too big, is reimplement my kmeans in 10 lines and after you update the centers, normalize them to put them back on the sphere. I don't think you can say much about convergence but it might work in practice. HTH Alex On Thu, Jan 24, 2013 at 1:24 AM,

Re: [Scikit-learn-general] K means on a sphere

2013-01-23 Thread Gael Varoquaux
On Thu, Jan 24, 2013 at 12:34:31AM +0100, Andreas Mueller wrote: > Sorry, custom metrics for K means are not possible at the moment. Yes, there is a massive difference in amount of work and performance when you try to replace the Euclidean distance. Amongst other problems, the mean is no longer th

Re: [Scikit-learn-general] K means on a sphere

2013-01-23 Thread Andreas Mueller
Hi Ariel. Sorry, custom metrics for K means are not possible at the moment. If you wanted to tweak the sklearn implementation, you would have to look into this file: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/cluster/k_means_.py#L413 In particular the function _labels_inert

[Scikit-learn-general] K means on a sphere

2013-01-23 Thread Ariel Rokem
Hi everyone, I am interested in using the sklearn implementation of k means to estimate clusters of unit vectors on the surface of a sphere. This requires that the distance metric be changed from the current Euclidean distance metric to angles. Is there any easy way to achieve that with the curr