<div><div dir="auto">Is it expected that all three linkages options should give the same result in my toy example?</div></div><div dir="auto"><br></div><div dir="auto">Raphael</div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, 26 Jul 2018 at 06:20 Gael Varoquaux <<a href="mailto:gael.varoquaux@normalesup.org">gael.varoquaux@normalesup.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FeatureAgglomeration uses the Ward, complete linkage, or average linkage,<br>
algorithms, depending on the choice of "linkage". These are well<br>
documented in the literature, or on wikipedia.<br>
<br>
Gaël<br>
<br>
On Thu, Jul 26, 2018 at 06:05:21AM +0100, Raphael C wrote:<br>
> Hi,<br>
<br>
> I am trying to work out what, in precise mathematical terms,<br>
> [FeatureAgglomeration][1] does and would love some help. Here is some example<br>
> code:<br>
<br>
<br>
>     import numpy as np<br>
>     from sklearn.cluster import FeatureAgglomeration<br>
>     for S in ['ward', 'average', 'complete']:<br>
>         FA = FeatureAgglomeration(linkage=S)<br>
>         print(FA.fit_transform(np.array([[-50,6,6,7,], [0,1,2,3]])))<br>
<br>
> This outputs:<br>
<br>
>    <br>
<br>
>     [[  6.33333333 -50.        ]<br>
>      [  2.           0.        ]]<br>
>     [[  6.33333333 -50.        ]<br>
>      [  2.           0.        ]]<br>
>     [[  6.33333333 -50.        ]<br>
>      [  2.           0.        ]]<br>
<br>
> Is it possible to say mathematically how these values have been computed?<br>
<br>
> Also, what exactly does linkage do and why doesn't it seem to make any<br>
> difference which option you choose?<br>
<br>
> Raphael<br>
<br>
<br>
>   [1]: <a href="http://scikit-learn.org/stable/modules/generated/" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/</a><br>
> sklearn.cluster.FeatureAgglomeration.html<br>
<br>
> PS I also asked at <br>
> <a href="https://stackoverflow.com/questions/51526616/" rel="noreferrer" target="_blank">https://stackoverflow.com/questions/51526616/</a><br>
> what-does-featureagglomeration-compute-mathematically-and-when-does-linkage-make<br>
<br>
<br>
> _______________________________________________<br>
> scikit-learn mailing list<br>
> <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
<br>
<br>
-- <br>
    Gael Varoquaux<br>
    Senior Researcher, INRIA Parietal<br>
    NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France<br>
    Phone:  ++ 33-1-69-08-79-68<br>
    <a href="http://gael-varoquaux.info" rel="noreferrer" target="_blank">http://gael-varoquaux.info</a>            <a href="http://twitter.com/GaelVaroquaux" rel="noreferrer" target="_blank">http://twitter.com/GaelVaroquaux</a><br>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div></div>