<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>There was a bug in 0.18 that was fixed here
      <a class="moz-txt-link-freetext" href="https://github.com/scikit-learn/scikit-learn/pull/9105">https://github.com/scikit-learn/scikit-learn/pull/9105</a></p>
    <p>The results from 0.20 should be correct.<br>
    </p>
    <p>It looks like you're still using Python 2, please be aware that <b>scikit-learn
        will drop support for python 2 in the next release</b>!</p>
    <p>Nicolas<br>
    </p>
    <div class="moz-cite-prefix">On 2/15/19 7:52 PM, Huan Tran wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAK9T6Gh2BHjyeHvRTZi+6W7hucr=6FfThX8aoZtncfkE9Gk4Vg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div>Dear community,</div>
                  <div><br>
                  </div>
                  <div>I did a very small pca analysis on a 3D data to
                    print out the explained_variance. I found that with
                    scikit-learn 0.18.1 AND 0.20.2, the results are
                    significantly different. In particular, for 0.18.1 I
                    got<br>
                  </div>
                  <div>+3.875925353581E+00 +3.270175297443E+00
                    +2.207814537475E+00</div>
                  <div><br>
                  </div>
                  <div>and with 0.20.2, I got</div>
                  <div>+4.651110424297E+00 +3.924210356932E+00
                    +2.649377444970E+00<br>
                  </div>
                  <div><br>
                  </div>
                  <div>Could anyone has a hint on what is going on? FYI,
                    my data and code are enclosed. Many thanks. <br>
                  </div>
                  <div><br>
                  </div>
                  <div>Huan<br>
                  </div>
                  <div> </div>
                  <div>My data is</div>
                  <div><br>
                  </div>
                  <div> -3.117642E+00,  1.453819E+00, -7.952874E-02<br>
                      3.081224E+00,  1.453819E+00, -7.952874E-02<br>
                      1.376932E-01, -2.491454E+00, -1.908521E-01<br>
                      9.578602E-02,  3.632759E+00, -1.908521E-01<br>
                     -1.238644E-01,  5.396424E-02, -3.147031E+00<br>
                      6.335262E-01,  1.393937E+00,  2.500474E+00<br>
                  </div>
                  <div><br>
                  </div>
                  <div>and my code is <br>
                  </div>
                  <div><br>
                  </div>
                  <div>import pandas as pd<br>
                    import numpy as np<br>
                    from sklearn import decomposition<br>
                    <br>
                    df = pd.read_csv('data', delimiter=',', header=None)<br>
                    data = np.array(df)<br>
                    <br>
                    X = data[:,:]<br>
                    data_size   = X.shape[0]<br>
                    feature_dim = X.shape[1]<br>
                    <br>
                    print X<br>
                    <br>
                    pca = decomposition.PCA(n_components=feature_dim)<br>
                    X_transformed = pca.fit_transform(X)<br>
                    print "%+4.12E %+4.12E %+4.12E"
                    %(pca.explained_variance_[0],
                    pca.explained_variance_[1],
                    pca.explained_variance_[2])<br>
                    <br>
                  </div>
                  <div><br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
scikit-learn mailing list
<a class="moz-txt-link-abbreviated" href="mailto:scikit-learn@python.org">scikit-learn@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/scikit-learn">https://mail.python.org/mailman/listinfo/scikit-learn</a>
</pre>
    </blockquote>
  </body>
</html>