<div><div dir="auto">Thank you all for your feedback. </div><div dir="auto">The initial problem I came with wasnt the definition of PCA but what the sklearn method does. In practice I would always make sure the data is both centered and scaled before performing PCA. This is the recommended method because without scaling, the biggest direction could wrongly seem to explain a huge fraction of the variance. </div><div dir="auto">So my point was simply to clarify in the help file and the user guide what the PCA class does precisely to leave no unclarity to the reader. Moving forward I have now submitted a pull request on github as initially suggested by Roman on this thread. </div><div dir="auto">Best,</div><div dir="auto">Ismael</div><br><div class="gmail_quote"><div>On Mon, 16 Oct 2017 at 11:49 AM, <<a href="mailto:scikit-learn-request@python.org">scikit-learn-request@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send scikit-learn mailing list submissions to<br>
        <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<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>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:scikit-learn-owner@python.org" target="_blank">scikit-learn-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of scikit-learn digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: 1. Re: unclear help file for sklearn.decomposition.pca<br>
      (Andreas Mueller)<br>
   2. Re: 1. Re: unclear help file for sklearn.decomposition.pca<br>
      (Oliver Tomic)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 16 Oct 2017 14:44:51 -0400<br>
From: Andreas Mueller <<a href="mailto:t3kcit@gmail.com" target="_blank">t3kcit@gmail.com</a>><br>
To: <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
Subject: Re: [scikit-learn] 1. Re: unclear help file for<br>
        sklearn.decomposition.pca<br>
Message-ID: <<a href="mailto:35142868-fce9-6cb3-eba3-015a0b106163@gmail.com" target="_blank">35142868-fce9-6cb3-eba3-015a0b106163@gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"; Format="flowed"<br>
<br>
<br>
<br>
On 10/16/2017 02:27 PM, Ismael Lemhadri wrote:<br>
> @Andreas Muller:<br>
> My references do not assume centering, e.g.<br>
> <a href="http://ufldl.stanford.edu/wiki/index.php/PCA" rel="noreferrer" target="_blank">http://ufldl.stanford.edu/wiki/index.php/PCA</a><br>
> any reference?<br>
><br>
It kinda does but is not very clear about it:<br>
<br>
This data has already been pre-processed so that each of the<br>
features\textstyle x_1and\textstyle x_2have about the same mean (zero)<br>
and variance.<br>
<br>
<br>
<br>
Wikipedia is much clearer:<br>
Consider a datamatrix<br>
<<a href="https://en.wikipedia.org/wiki/Matrix_%28mathematics%29" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Matrix_%28mathematics%29</a>>,*X*, with<br>
column-wise zeroempirical mean<br>
<<a href="https://en.wikipedia.org/wiki/Empirical_mean" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Empirical_mean</a>>(the sample mean of each<br>
column has been shifted to zero), where each of the/n/rows represents a<br>
different repetition of the experiment, and each of the/p/columns gives<br>
a particular kind of feature (say, the results from a particular sensor).<br>
<a href="https://en.wikipedia.org/wiki/Principal_component_analysis#Details" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Principal_component_analysis#Details</a><br>
<br>
I'm a bit surprised to find that ESL says "The SVD of the centered<br>
matrix X is another way of expressing the principal components of the<br>
variables in X",<br>
so they assume scaling? They don't really have a great treatment of PCA,<br>
though.<br>
<br>
Bishop <<a href="http://www.springer.com/us/book/9780387310732" rel="noreferrer" target="_blank">http://www.springer.com/us/book/9780387310732</a>> and Murphy<br>
<<a href="https://mitpress.mit.edu/books/machine-learning-0" rel="noreferrer" target="_blank">https://mitpress.mit.edu/books/machine-learning-0</a>> are pretty clear<br>
that they subtract the mean (or assume zero mean) but don't standardize.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/81b3014b/attachment-0001.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/81b3014b/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 16 Oct 2017 20:48:29 +0200<br>
From: Oliver Tomic <<a href="mailto:olivertomic@zoho.com" target="_blank">olivertomic@zoho.com</a>><br>
To: "Scikit-learn mailing list" <<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>><br>
Cc: <<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>><br>
Subject: Re: [scikit-learn] 1. Re: unclear help file for<br>
        sklearn.decomposition.pca<br>
Message-ID: <<a href="mailto:15f26840d65.e97b33c25239.3934951873824890747@zoho.com" target="_blank">15f26840d65.e97b33c25239.3934951873824890747@zoho.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear Ismael,<br>
<br>
<br>
<br>
PCA should always involve at the least centering, or, if the variables are to contribute equally, scaling. Here is a reference from the scientific area named "chemometrics". In Chemometrics PCA used not only for dimensionality reduction, but also for interpretation of variance by use of scores, loadings, correlation loadings, etc.<br>
<br>
<br>
<br>
If you scroll down to subsection "Preprocessing" you will find more info on centering and scaling.<br>
<br>
<br>
<a href="http://pubs.rsc.org/en/content/articlehtml/2014/ay/c3ay41907j" rel="noreferrer" target="_blank">http://pubs.rsc.org/en/content/articlehtml/2014/ay/c3ay41907j</a><br>
<br>
<br>
<br>
best<br>
<br>
Oliver<br>
<br>
<br>
<br>
<br>
---- On Mon, 16 Oct 2017 20:27:11 +0200 Ismael Lemhadri &<a href="mailto:lt%3Blemhadri@stanford.edu" target="_blank">lt;lemhadri@stanford.edu</a>&gt; wrote ----<br>
<br>
<br>
<br>
<br>
@Andreas Muller:<br>
<br>
My references do not assume centering, e.g. <a href="http://ufldl.stanford.edu/wiki/index.php/PCA" rel="noreferrer" target="_blank">http://ufldl.stanford.edu/wiki/index.php/PCA</a><br>
<br>
any reference?<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Mon, Oct 16, 2017 at 10:20 AM, &<a href="mailto:lt%3Bscikit-learn-request@python.org" target="_blank">lt;scikit-learn-request@python.org</a>&gt; wrote:<br>
<br>
Send scikit-learn mailing list submissions to<br>
<br>
         <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<br>
<br>
<br>
 To subscribe or unsubscribe via the World Wide Web, visit<br>
<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>
 or, via email, send a message with subject or body 'help' to<br>
<br>
         <a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a><br>
<br>
<br>
<br>
 You can reach the person managing the list at<br>
<br>
         <a href="mailto:scikit-learn-owner@python.org" target="_blank">scikit-learn-owner@python.org</a><br>
<br>
<br>
<br>
 When replying, please edit your Subject line so it is more specific<br>
<br>
 than "Re: Contents of scikit-learn digest..."<br>
<br>
<br>
<br>
<br>
<br>
 Today's Topics:<br>
<br>
<br>
<br>
    1. Re: unclear help file for sklearn.decomposition.pca<br>
<br>
       (Andreas Mueller)<br>
<br>
<br>
<br>
<br>
<br>
 ----------------------------------------------------------------------<br>
<br>
<br>
<br>
 Message: 1<br>
<br>
 Date: Mon, 16 Oct 2017 13:19:57 -0400<br>
<br>
 From: Andreas Mueller &<a href="mailto:lt%3Bt3kcit@gmail.com" target="_blank">lt;t3kcit@gmail.com</a>&gt;<br>
<br>
 To: <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<br>
 Subject: Re: [scikit-learn] unclear help file for<br>
<br>
         sklearn.decomposition.pca<br>
<br>
 Message-ID: &<a href="mailto:lt%3B04fc445c-d8f3-a3a9-4ab2-0535826a2d03@gmail.com" target="_blank">lt;04fc445c-d8f3-a3a9-4ab2-0535826a2d03@gmail.com</a>&gt;<br>
<br>
 Content-Type: text/plain; charset="utf-8"; Format="flowed"<br>
<br>
<br>
<br>
 The definition of PCA has a centering step, but no scaling step.<br>
<br>
<br>
<br>
 On 10/16/2017 11:16 AM, Ismael Lemhadri wrote:<br>
<br>
 &gt; Dear Roman,<br>
<br>
 &gt; My concern is actually not about not mentioning the scaling but about<br>
<br>
 &gt; not mentioning the centering.<br>
<br>
 &gt; That is, the sklearn PCA removes the mean but it does not mention it<br>
<br>
 &gt; in the help file.<br>
<br>
 &gt; This was quite messy for me to debug as I expected it to either: 1/<br>
<br>
 &gt; center and scale simultaneously or / not scale and not center either.<br>
<br>
 &gt; It would be beneficial to explicit the behavior in the help file in my<br>
<br>
 &gt; opinion.<br>
<br>
 &gt; Ismael<br>
<br>
 &gt;<br>
<br>
 &gt; On Mon, Oct 16, 2017 at 8:02 AM, &<a href="mailto:lt%3Bscikit-learn-request@python.org" target="_blank">lt;scikit-learn-request@python.org</a><br>
<br>
 &gt; &lt;mailto:<a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a>&gt;&gt; wrote:<br>
<br>
 &gt;<br>
<br>
 &gt;     Send scikit-learn mailing list submissions to<br>
<br>
 &gt;     <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     To subscribe or unsubscribe via the World Wide Web, visit<br>
<br>
 &gt;     <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>
 &gt;     &lt;<a href="https://mail.python.org/mailman/listinfo/scikit-learn&gt" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn&gt</a>;<br>
<br>
 &gt;     or, via email, send a message with subject or body 'help' to<br>
<br>
 &gt;     <a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a>&gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     You can reach the person managing the list at<br>
<br>
 &gt;     <a href="mailto:scikit-learn-owner@python.org" target="_blank">scikit-learn-owner@python.org</a> &lt;mailto:<a href="mailto:scikit-learn-owner@python.org" target="_blank">scikit-learn-owner@python.org</a>&gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     When replying, please edit your Subject line so it is more specific<br>
<br>
 &gt;     than "Re: Contents of scikit-learn digest..."<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     Today's Topics:<br>
<br>
 &gt;<br>
<br>
 &gt;     ? ?1. unclear help file for sklearn.decomposition.pca (Ismael<br>
<br>
 &gt;     Lemhadri)<br>
<br>
 &gt;     ? ?2. Re: unclear help file for sklearn.decomposition.pca<br>
<br>
 &gt;     ? ? ? (Roman Yurchak)<br>
<br>
 &gt;     ? ?3. Question about LDA's coef_ attribute (Serafeim Loukas)<br>
<br>
 &gt;     ? ?4. Re: Question about LDA's coef_ attribute (Alexandre Gramfort)<br>
<br>
 &gt;     ? ?5. Re: Question about LDA's coef_ attribute (Serafeim Loukas)<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     ----------------------------------------------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     Message: 1<br>
<br>
 &gt;     Date: Sun, 15 Oct 2017 18:42:56 -0700<br>
<br>
 &gt;     From: Ismael Lemhadri &<a href="mailto:lt%3Blemhadri@stanford.edu" target="_blank">lt;lemhadri@stanford.edu</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:lemhadri@stanford.edu" target="_blank">lemhadri@stanford.edu</a>&gt;&gt;<br>
<br>
 &gt;     To: <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     Subject: [scikit-learn] unclear help file for<br>
<br>
 &gt;     ? ? ? ? sklearn.decomposition.pca<br>
<br>
 &gt;     Message-ID:<br>
<br>
 &gt;     ? ? ? ?<br>
<br>
 &gt;     &lt;CANpSPFTgv+Oz7f97dandmrBBayqf_o9w=<a href="mailto:18oKHCFN0u5DNzj%2Bg@mail.gmail.com" target="_blank">18oKHCFN0u5DNzj+g@mail.gmail.com</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:18oKHCFN0u5DNzj%252Bg@mail.gmail.com" target="_blank">18oKHCFN0u5DNzj%2Bg@mail.gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     Content-Type: text/plain; charset="utf-8"<br>
<br>
 &gt;<br>
<br>
 &gt;     Dear all,<br>
<br>
 &gt;     The help file for the PCA class is unclear about the preprocessing<br>
<br>
 &gt;     performed to the data.<br>
<br>
 &gt;     You can check on line 410 here:<br>
<br>
 &gt;     <a href="https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/</a><br>
<br>
 &gt;     decomposition/pca.py#L410<br>
<br>
 &gt;     &lt;<a href="https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/%0Adecomposition/pca.py#L410&gt" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/%0Adecomposition/pca.py#L410&gt</a>;<br>
<br>
 &gt;     that the matrix is centered but NOT scaled, before performing the<br>
<br>
 &gt;     singular<br>
<br>
 &gt;     value decomposition.<br>
<br>
 &gt;     However, the help files do not make any mention of it.<br>
<br>
 &gt;     This is unclear for someone who, like me, just wanted to compare<br>
<br>
 &gt;     that the<br>
<br>
 &gt;     PCA and np.linalg.svd give the same results. In academic settings,<br>
<br>
 &gt;     students<br>
<br>
 &gt;     are often asked to compare different methods and to check that<br>
<br>
 &gt;     they yield<br>
<br>
 &gt;     the same results. I expect that many students have confronted this<br>
<br>
 &gt;     problem<br>
<br>
 &gt;     before...<br>
<br>
 &gt;     Best,<br>
<br>
 &gt;     Ismael Lemhadri<br>
<br>
 &gt;     -------------- next part --------------<br>
<br>
 &gt;     An HTML attachment was scrubbed...<br>
<br>
 &gt;     URL:<br>
<br>
 &gt;     &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171015/c465bde7/attachment-0001.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171015/c465bde7/attachment-0001.html</a><br>
<br>
 &gt;     &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171015/c465bde7/attachment-0001.html&gt;&gt" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171015/c465bde7/attachment-0001.html&gt;&gt</a>;<br>
<br>
 &gt;<br>
<br>
 &gt;     ------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     Message: 2<br>
<br>
 &gt;     Date: Mon, 16 Oct 2017 15:16:45 +0200<br>
<br>
 &gt;     From: Roman Yurchak &<a href="mailto:lt%3Brth.yurchak@gmail.com" target="_blank">lt;rth.yurchak@gmail.com</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:rth.yurchak@gmail.com" target="_blank">rth.yurchak@gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     To: Scikit-learn mailing list &<a href="mailto:lt%3Bscikit-learn@python.org" target="_blank">lt;scikit-learn@python.org</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;&gt;<br>
<br>
 &gt;     Subject: Re: [scikit-learn] unclear help file for<br>
<br>
 &gt;     ? ? ? ? sklearn.decomposition.pca<br>
<br>
 &gt;     Message-ID: &<a href="mailto:lt%3Bb2abdcfd-4736-929e-6304-b93832932043@gmail.com" target="_blank">lt;b2abdcfd-4736-929e-6304-b93832932043@gmail.com</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:b2abdcfd-4736-929e-6304-b93832932043@gmail.com" target="_blank">b2abdcfd-4736-929e-6304-b93832932043@gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     Content-Type: text/plain; charset=utf-8; format=flowed<br>
<br>
 &gt;<br>
<br>
 &gt;     Ismael,<br>
<br>
 &gt;<br>
<br>
 &gt;     as far as I saw the sklearn.decomposition.PCA doesn't mention<br>
<br>
 &gt;     scaling at<br>
<br>
 &gt;     all (except for the whiten parameter which is post-transformation<br>
<br>
 &gt;     scaling).<br>
<br>
 &gt;<br>
<br>
 &gt;     So since it doesn't mention it, it makes sense that it doesn't do any<br>
<br>
 &gt;     scaling of the input. Same as np.linalg.svd.<br>
<br>
 &gt;<br>
<br>
 &gt;     You can verify that PCA and np.linalg.svd yield the same results, with<br>
<br>
 &gt;<br>
<br>
 &gt;     ```<br>
<br>
 &gt;     ?&gt;&gt;&gt; import numpy as np<br>
<br>
 &gt;     ?&gt;&gt;&gt; from sklearn.decomposition import PCA<br>
<br>
 &gt;     ?&gt;&gt;&gt; import numpy.linalg<br>
<br>
 &gt;     ?&gt;&gt;&gt; X = np.random.RandomState(42).rand(10, 4)<br>
<br>
 &gt;     ?&gt;&gt;&gt; n_components = 2<br>
<br>
 &gt;     ?&gt;&gt;&gt; PCA(n_components, svd_solver='full').fit_transform(X)<br>
<br>
 &gt;     ```<br>
<br>
 &gt;<br>
<br>
 &gt;     and<br>
<br>
 &gt;<br>
<br>
 &gt;     ```<br>
<br>
 &gt;     ?&gt;&gt;&gt; U, s, V = np.linalg.svd(X - X.mean(axis=0), full_matrices=False)<br>
<br>
 &gt;     ?&gt;&gt;&gt; (X - X.mean(axis=0)).dot(V[:n_components].T)<br>
<br>
 &gt;     ```<br>
<br>
 &gt;<br>
<br>
 &gt;     --<br>
<br>
 &gt;     Roman<br>
<br>
 &gt;<br>
<br>
 &gt;     On 16/10/17 03:42, Ismael Lemhadri wrote:<br>
<br>
 &gt;     &gt; Dear all,<br>
<br>
 &gt;     &gt; The help file for the PCA class is unclear about the preprocessing<br>
<br>
 &gt;     &gt; performed to the data.<br>
<br>
 &gt;     &gt; You can check on line 410 here:<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     <a href="https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410</a><br>
<br>
 &gt;     &lt;<a href="https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410&gt" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410&gt</a>;<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &lt;<a href="https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410</a><br>
<br>
 &gt;     &lt;<a href="https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410&gt;&gt" rel="noreferrer" target="_blank">https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/decomposition/pca.py#L410&gt;&gt</a>;<br>
<br>
 &gt;     &gt; that the matrix is centered but NOT scaled, before performing the<br>
<br>
 &gt;     &gt; singular value decomposition.<br>
<br>
 &gt;     &gt; However, the help files do not make any mention of it.<br>
<br>
 &gt;     &gt; This is unclear for someone who, like me, just wanted to compare<br>
<br>
 &gt;     that<br>
<br>
 &gt;     &gt; the PCA and np.linalg.svd give the same results. In academic<br>
<br>
 &gt;     settings,<br>
<br>
 &gt;     &gt; students are often asked to compare different methods and to<br>
<br>
 &gt;     check that<br>
<br>
 &gt;     &gt; they yield the same results. I expect that many students have<br>
<br>
 &gt;     confronted<br>
<br>
 &gt;     &gt; this problem before...<br>
<br>
 &gt;     &gt; Best,<br>
<br>
 &gt;     &gt; Ismael Lemhadri<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; _______________________________________________<br>
<br>
 &gt;     &gt; scikit-learn mailing list<br>
<br>
 &gt;     &gt; <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     &gt; <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>
 &gt;     &lt;<a href="https://mail.python.org/mailman/listinfo/scikit-learn&gt" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn&gt</a>;<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     ------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     Message: 3<br>
<br>
 &gt;     Date: Mon, 16 Oct 2017 15:27:48 +0200<br>
<br>
 &gt;     From: Serafeim Loukas &<a href="mailto:lt%3Bseralouk@gmail.com" target="_blank">lt;seralouk@gmail.com</a> &lt;mailto:<a href="mailto:seralouk@gmail.com" target="_blank">seralouk@gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     To: <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     Subject: [scikit-learn] Question about LDA's coef_ attribute<br>
<br>
 &gt;     Message-ID: &<a href="mailto:lt%3B58C6D0DA-9DE5-4EF5-97C1-48159831F5A9@gmail.com" target="_blank">lt;58C6D0DA-9DE5-4EF5-97C1-48159831F5A9@gmail.com</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:58C6D0DA-9DE5-4EF5-97C1-48159831F5A9@gmail.com" target="_blank">58C6D0DA-9DE5-4EF5-97C1-48159831F5A9@gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     Content-Type: text/plain; charset="us-ascii"<br>
<br>
 &gt;<br>
<br>
 &gt;     Dear Scikit-learn community,<br>
<br>
 &gt;<br>
<br>
 &gt;     Since the documentation of the LDA<br>
<br>
 &gt;     (<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html</a><br>
<br>
 &gt;     &lt;<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt</a>;<br>
<br>
 &gt;     &lt;<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html</a><br>
<br>
 &gt;     &lt;<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt;&gt" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt;&gt</a>;)<br>
<br>
 &gt;     is not so clear, I would like to ask if the lda.coef_ attribute<br>
<br>
 &gt;     stores the eigenvectors from the SVD decomposition.<br>
<br>
 &gt;<br>
<br>
 &gt;     Thank you in advance,<br>
<br>
 &gt;     Serafeim<br>
<br>
 &gt;     -------------- next part --------------<br>
<br>
 &gt;     An HTML attachment was scrubbed...<br>
<br>
 &gt;     URL:<br>
<br>
 &gt;     &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/4263df5c/attachment-0001.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/4263df5c/attachment-0001.html</a><br>
<br>
 &gt;     &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/4263df5c/attachment-0001.html&gt;&gt" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/4263df5c/attachment-0001.html&gt;&gt</a>;<br>
<br>
 &gt;<br>
<br>
 &gt;     ------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     Message: 4<br>
<br>
 &gt;     Date: Mon, 16 Oct 2017 16:57:52 +0200<br>
<br>
 &gt;     From: Alexandre Gramfort &<a href="mailto:lt%3Balexandre.gramfort@inria.fr" target="_blank">lt;alexandre.gramfort@inria.fr</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:alexandre.gramfort@inria.fr" target="_blank">alexandre.gramfort@inria.fr</a>&gt;&gt;<br>
<br>
 &gt;     To: Scikit-learn mailing list &<a href="mailto:lt%3Bscikit-learn@python.org" target="_blank">lt;scikit-learn@python.org</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;&gt;<br>
<br>
 &gt;     Subject: Re: [scikit-learn] Question about LDA's coef_ attribute<br>
<br>
 &gt;     Message-ID:<br>
<br>
 &gt;     ? ? ? ?<br>
<br>
 &gt;     &<a href="mailto:lt%3BCADeotZricOQhuHJMmW2Z14cqffEQyndYoxn-OgKAvTMQ7V0Y2g@mail.gmail.com" target="_blank">lt;CADeotZricOQhuHJMmW2Z14cqffEQyndYoxn-OgKAvTMQ7V0Y2g@mail.gmail.com</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:CADeotZricOQhuHJMmW2Z14cqffEQyndYoxn-OgKAvTMQ7V0Y2g@mail.gmail.com" target="_blank">CADeotZricOQhuHJMmW2Z14cqffEQyndYoxn-OgKAvTMQ7V0Y2g@mail.gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     Content-Type: text/plain; charset="UTF-8"<br>
<br>
 &gt;<br>
<br>
 &gt;     no it stores the direction of the decision function to match the<br>
<br>
 &gt;     API of<br>
<br>
 &gt;     linear models.<br>
<br>
 &gt;<br>
<br>
 &gt;     HTH<br>
<br>
 &gt;     Alex<br>
<br>
 &gt;<br>
<br>
 &gt;     On Mon, Oct 16, 2017 at 3:27 PM, Serafeim Loukas<br>
<br>
 &gt;     &<a href="mailto:lt%3Bseralouk@gmail.com" target="_blank">lt;seralouk@gmail.com</a> &lt;mailto:<a href="mailto:seralouk@gmail.com" target="_blank">seralouk@gmail.com</a>&gt;&gt; wrote:<br>
<br>
 &gt;     &gt; Dear Scikit-learn community,<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; Since the documentation of the LDA<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     (<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html</a><br>
<br>
 &gt;     &lt;<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt</a>;)<br>
<br>
 &gt;     &gt; is not so clear, I would like to ask if the lda.coef_ attribute<br>
<br>
 &gt;     stores the<br>
<br>
 &gt;     &gt; eigenvectors from the SVD decomposition.<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; Thank you in advance,<br>
<br>
 &gt;     &gt; Serafeim<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; _______________________________________________<br>
<br>
 &gt;     &gt; scikit-learn mailing list<br>
<br>
 &gt;     &gt; <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     &gt; <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>
 &gt;     &lt;<a href="https://mail.python.org/mailman/listinfo/scikit-learn&gt" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn&gt</a>;<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     ------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     Message: 5<br>
<br>
 &gt;     Date: Mon, 16 Oct 2017 17:02:46 +0200<br>
<br>
 &gt;     From: Serafeim Loukas &<a href="mailto:lt%3Bseralouk@gmail.com" target="_blank">lt;seralouk@gmail.com</a> &lt;mailto:<a href="mailto:seralouk@gmail.com" target="_blank">seralouk@gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     To: Scikit-learn mailing list &<a href="mailto:lt%3Bscikit-learn@python.org" target="_blank">lt;scikit-learn@python.org</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;&gt;<br>
<br>
 &gt;     Subject: Re: [scikit-learn] Question about LDA's coef_ attribute<br>
<br>
 &gt;     Message-ID: &<a href="mailto:lt%3B413210D2-56AE-41A4-873F-D171BB36539D@gmail.com" target="_blank">lt;413210D2-56AE-41A4-873F-D171BB36539D@gmail.com</a><br>
<br>
 &gt;     &lt;mailto:<a href="mailto:413210D2-56AE-41A4-873F-D171BB36539D@gmail.com" target="_blank">413210D2-56AE-41A4-873F-D171BB36539D@gmail.com</a>&gt;&gt;<br>
<br>
 &gt;     Content-Type: text/plain; charset="us-ascii"<br>
<br>
 &gt;<br>
<br>
 &gt;     Dear Alex,<br>
<br>
 &gt;<br>
<br>
 &gt;     Thank you for the prompt response.<br>
<br>
 &gt;<br>
<br>
 &gt;     Are the eigenvectors stored in some variable ?<br>
<br>
 &gt;     Does the lda.scalings_ attribute contain the eigenvectors ?<br>
<br>
 &gt;<br>
<br>
 &gt;     Best,<br>
<br>
 &gt;     Serafeim<br>
<br>
 &gt;<br>
<br>
 &gt;     &gt; On 16 Oct 2017, at 16:57, Alexandre Gramfort<br>
<br>
 &gt;     &<a href="mailto:lt%3Balexandre.gramfort@inria.fr" target="_blank">lt;alexandre.gramfort@inria.fr</a> &lt;mailto:<a href="mailto:alexandre.gramfort@inria.fr" target="_blank">alexandre.gramfort@inria.fr</a>&gt;&gt;<br>
<br>
 &gt;     wrote:<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; no it stores the direction of the decision function to match the<br>
<br>
 &gt;     API of<br>
<br>
 &gt;     &gt; linear models.<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; HTH<br>
<br>
 &gt;     &gt; Alex<br>
<br>
 &gt;     &gt;<br>
<br>
 &gt;     &gt; On Mon, Oct 16, 2017 at 3:27 PM, Serafeim Loukas<br>
<br>
 &gt;     &<a href="mailto:lt%3Bseralouk@gmail.com" target="_blank">lt;seralouk@gmail.com</a> &lt;mailto:<a href="mailto:seralouk@gmail.com" target="_blank">seralouk@gmail.com</a>&gt;&gt; wrote:<br>
<br>
 &gt;     &gt;&gt; Dear Scikit-learn community,<br>
<br>
 &gt;     &gt;&gt;<br>
<br>
 &gt;     &gt;&gt; Since the documentation of the LDA<br>
<br>
 &gt;     &gt;&gt;<br>
<br>
 &gt;     (<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html</a><br>
<br>
 &gt;     &lt;<a href="http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt" rel="noreferrer" target="_blank">http://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.LinearDiscriminantAnalysis.html&gt</a>;)<br>
<br>
 &gt;     &gt;&gt; is not so clear, I would like to ask if the lda.coef_ attribute<br>
<br>
 &gt;     stores the<br>
<br>
 &gt;     &gt;&gt; eigenvectors from the SVD decomposition.<br>
<br>
 &gt;     &gt;&gt;<br>
<br>
 &gt;     &gt;&gt; Thank you in advance,<br>
<br>
 &gt;     &gt;&gt; Serafeim<br>
<br>
 &gt;     &gt;&gt;<br>
<br>
 &gt;     &gt;&gt; _______________________________________________<br>
<br>
 &gt;     &gt;&gt; scikit-learn mailing list<br>
<br>
 &gt;     &gt;&gt; <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     &gt;&gt; <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>
 &gt;     &lt;<a href="https://mail.python.org/mailman/listinfo/scikit-learn&gt" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn&gt</a>;<br>
<br>
 &gt;     &gt;&gt;<br>
<br>
 &gt;     &gt; _______________________________________________<br>
<br>
 &gt;     &gt; scikit-learn mailing list<br>
<br>
 &gt;     &gt; <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     &gt; <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>
 &gt;     &lt;<a href="https://mail.python.org/mailman/listinfo/scikit-learn&gt" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn&gt</a>;<br>
<br>
 &gt;<br>
<br>
 &gt;     -------------- next part --------------<br>
<br>
 &gt;     An HTML attachment was scrubbed...<br>
<br>
 &gt;     URL:<br>
<br>
 &gt;     &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/505c7da3/attachment.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/505c7da3/attachment.html</a><br>
<br>
 &gt;     &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/505c7da3/attachment.html&gt;&gt" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/505c7da3/attachment.html&gt;&gt</a>;<br>
<br>
 &gt;<br>
<br>
 &gt;     ------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     Subject: Digest Footer<br>
<br>
 &gt;<br>
<br>
 &gt;     _______________________________________________<br>
<br>
 &gt;     scikit-learn mailing list<br>
<br>
 &gt;     <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a> &lt;mailto:<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>&gt;<br>
<br>
 &gt;     <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>
 &gt;     &lt;<a href="https://mail.python.org/mailman/listinfo/scikit-learn&gt" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn&gt</a>;<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;     ------------------------------<br>
<br>
 &gt;<br>
<br>
 &gt;     End of scikit-learn Digest, Vol 19, Issue 25<br>
<br>
 &gt;     ********************************************<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt;<br>
<br>
 &gt; _______________________________________________<br>
<br>
 &gt; scikit-learn mailing list<br>
<br>
 &gt; <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<br>
 &gt; <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>
 -------------- next part --------------<br>
<br>
 An HTML attachment was scrubbed...<br>
<br>
 URL: &lt;<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/f47e63a9/attachment.html&gt" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/f47e63a9/attachment.html&gt</a>;<br>
<br>
<br>
<br>
 ------------------------------<br>
<br>
<br>
<br>
 Subject: Digest Footer<br>
<br>
<br>
<br>
 _______________________________________________<br>
<br>
 scikit-learn mailing list<br>
<br>
 <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<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>
<br>
<br>
 ------------------------------<br>
<br>
<br>
<br>
 End of scikit-learn Digest, Vol 19, Issue 28<br>
<br>
 ********************************************<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
<br>
scikit-learn mailing list<br>
<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<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>
<br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20171016/620a9401/attachment.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20171016/620a9401/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<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>
<br>
End of scikit-learn Digest, Vol 19, Issue 31<br>
********************************************<br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><br>Sent from a mobile phone and may contain errors</div>