Spherical Kmeans #OT
Hi , is there any Python package available for experiment with Sperical Kmeans ? -- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence) Michael On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi , is there any Python package available for experiment with Sperical Kmeans ?
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
Per the example here: http://scikit-learn.org/stable/auto_examples/text/document_clustering.html if your inputs are normalized, sklearn's kmeans behaves like sperical kmeans (unless I'm misunderstanding something, which is certainly possible, caveat lector, &c )... On Jun 27, 2016 12:13 PM, "Michael Eickenberg" <michael.eickenberg@gmail.com> wrote:
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence)
Michael
On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi , is there any Python package available for experiment with Sperical Kmeans ?
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Hi Fred and Michel, Thanks for the reply . I think I git this and am able to run it. Best Jagan On Mon, Jun 27, 2016 at 1:03 PM, Fred Mailhot <fred.mailhot@gmail.com> wrote:
Per the example here:
http://scikit-learn.org/stable/auto_examples/text/document_clustering.html
if your inputs are normalized, sklearn's kmeans behaves like sperical kmeans (unless I'm misunderstanding something, which is certainly possible, caveat lector, &c )... On Jun 27, 2016 12:13 PM, "Michael Eickenberg" < michael.eickenberg@gmail.com> wrote:
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence)
Michael
On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi , is there any Python package available for experiment with Sperical Kmeans ?
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
You could do from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn.cluster import KMeans # (or e.g. MiniBatchKMeans) spherical_kmeans = make_pipeline(Normalizer(), KMeans(n_clusters=5)) On Tue, Jun 28, 2016 at 12:28 AM, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi Fred and Michel,
Thanks for the reply . I think I git this and am able to run it.
Best Jagan
On Mon, Jun 27, 2016 at 1:03 PM, Fred Mailhot <fred.mailhot@gmail.com> wrote:
Per the example here:
http://scikit-learn.org/stable/auto_examples/text/document_clustering.html
if your inputs are normalized, sklearn's kmeans behaves like sperical kmeans (unless I'm misunderstanding something, which is certainly possible, caveat lector, &c )... On Jun 27, 2016 12:13 PM, "Michael Eickenberg" < michael.eickenberg@gmail.com> wrote:
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence)
Michael
On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi , is there any Python package available for experiment with Sperical Kmeans ?
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
(Since Normalizer is applied to each sample independently, the Pipeline/Transformer mechanism doesn't actually provide any benefit over sklearn.preprocessing.normalize) On 28 June 2016 at 09:20, Michael Eickenberg <michael.eickenberg@gmail.com> wrote:
You could do
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn.cluster import KMeans # (or e.g. MiniBatchKMeans)
spherical_kmeans = make_pipeline(Normalizer(), KMeans(n_clusters=5))
On Tue, Jun 28, 2016 at 12:28 AM, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi Fred and Michel,
Thanks for the reply . I think I git this and am able to run it.
Best Jagan
On Mon, Jun 27, 2016 at 1:03 PM, Fred Mailhot <fred.mailhot@gmail.com> wrote:
Per the example here:
http://scikit-learn.org/stable/auto_examples/text/document_clustering.html
if your inputs are normalized, sklearn's kmeans behaves like sperical kmeans (unless I'm misunderstanding something, which is certainly possible, caveat lector, &c )... On Jun 27, 2016 12:13 PM, "Michael Eickenberg" < michael.eickenberg@gmail.com> wrote:
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence)
Michael
On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi , is there any Python package available for experiment with Sperical Kmeans ?
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
well, true :) but you can put it in pipelines! :) (so, in that logic, is there any reason for keeping it in the package?) On Tuesday, June 28, 2016, Joel Nothman <joel.nothman@gmail.com> wrote:
(Since Normalizer is applied to each sample independently, the Pipeline/Transformer mechanism doesn't actually provide any benefit over sklearn.preprocessing.normalize)
On 28 June 2016 at 09:20, Michael Eickenberg <michael.eickenberg@gmail.com <javascript:_e(%7B%7D,'cvml','michael.eickenberg@gmail.com');>> wrote:
You could do
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn.cluster import KMeans # (or e.g. MiniBatchKMeans)
spherical_kmeans = make_pipeline(Normalizer(), KMeans(n_clusters=5))
On Tue, Jun 28, 2016 at 12:28 AM, JAGANADH G <jaganadhg@gmail.com <javascript:_e(%7B%7D,'cvml','jaganadhg@gmail.com');>> wrote:
Hi Fred and Michel,
Thanks for the reply . I think I git this and am able to run it.
Best Jagan
On Mon, Jun 27, 2016 at 1:03 PM, Fred Mailhot <fred.mailhot@gmail.com <javascript:_e(%7B%7D,'cvml','fred.mailhot@gmail.com');>> wrote:
Per the example here:
http://scikit-learn.org/stable/auto_examples/text/document_clustering.html
if your inputs are normalized, sklearn's kmeans behaves like sperical kmeans (unless I'm misunderstanding something, which is certainly possible, caveat lector, &c )... On Jun 27, 2016 12:13 PM, "Michael Eickenberg" < michael.eickenberg@gmail.com <javascript:_e(%7B%7D,'cvml','michael.eickenberg@gmail.com');>> wrote:
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence)
Michael
On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com <javascript:_e(%7B%7D,'cvml','jaganadhg@gmail.com');>> wrote:
Hi , is there any Python package available for experiment with Sperical Kmeans ?
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org <javascript:_e(%7B%7D,'cvml','scikit-learn@python.org');> https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org <javascript:_e(%7B%7D,'cvml','scikit-learn@python.org');> https://mail.python.org/mailman/listinfo/scikit-learn
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org <javascript:_e(%7B%7D,'cvml','scikit-learn@python.org');> https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org <javascript:_e(%7B%7D,'cvml','scikit-learn@python.org');> https://mail.python.org/mailman/listinfo/scikit-learn
It may be useful in a pipeline if you need to normalise between a preceding transformer and a following estimator. On 28 June 2016 at 16:09, Michael Eickenberg <michael.eickenberg@gmail.com> wrote:
well, true :)
but you can put it in pipelines! :)
(so, in that logic, is there any reason for keeping it in the package?)
On Tuesday, June 28, 2016, Joel Nothman <joel.nothman@gmail.com> wrote:
(Since Normalizer is applied to each sample independently, the Pipeline/Transformer mechanism doesn't actually provide any benefit over sklearn.preprocessing.normalize)
On 28 June 2016 at 09:20, Michael Eickenberg < michael.eickenberg@gmail.com> wrote:
You could do
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn.cluster import KMeans # (or e.g. MiniBatchKMeans)
spherical_kmeans = make_pipeline(Normalizer(), KMeans(n_clusters=5))
On Tue, Jun 28, 2016 at 12:28 AM, JAGANADH G <jaganadhg@gmail.com> wrote:
Hi Fred and Michel,
Thanks for the reply . I think I git this and am able to run it.
Best Jagan
On Mon, Jun 27, 2016 at 1:03 PM, Fred Mailhot <fred.mailhot@gmail.com> wrote:
Per the example here:
http://scikit-learn.org/stable/auto_examples/text/document_clustering.html
if your inputs are normalized, sklearn's kmeans behaves like sperical kmeans (unless I'm misunderstanding something, which is certainly possible, caveat lector, &c )... On Jun 27, 2016 12:13 PM, "Michael Eickenberg" < michael.eickenberg@gmail.com> wrote:
hmm, not an answer, and off the top of my head: if you normalize your data points to l2 norm equal 1, and then use standard kmeans with euclidean distance (which then amounts to 2 - 2 cos(angle between points)) would this be enough for your purposes? (with a bit of luck there may even be some sort of correspondence)
Michael
On Monday, June 27, 2016, JAGANADH G <jaganadhg@gmail.com> wrote:
> Hi , > is there any Python package available for experiment with Sperical > Kmeans ? > > > -- > ********************************** > JAGANADH G > http://jaganadhg.in > *ILUGCBE* > http://ilugcbe.org.in >
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
-- ********************************** JAGANADH G http://jaganadhg.in *ILUGCBE* http://ilugcbe.org.in
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
participants (4)
-
Fred Mailhot -
JAGANADH G -
Joel Nothman -
Michael Eickenberg