title: PCA shows low explained variance score
body: <p>I used PCA to visualise 100 dimensional data into two dimensions:</p>
  
  <pre><code>x = df.loc[:, features].values # shape of: (8000, 100)
  y = df.loc[:,['target']].values
  x = StandardScaler().fit_transform(x)
  
  pca = PCA(n_components=2)
  principalComponents = pca.fit_transform(x)
  bb = pca.explained_variance_.sum()
  </code></pre>
  
  <p><code>print (bb)</code> gives: <code>7.952215165291998</code></p>
  
  <p><code>np.cumsum((pca.explained_variance_))</code> gives: <code>[4.87586249 7.95221329]</code></p>
  
  <p><code>pca.explained_variance_ratio_</code> gives: <code>[0.04875253 0.03075967]</code></p>
  
  <p>plotting it gives:</p>
  
  <pre><code>plt.plot(np.cumsum((pca.explained_variance_)))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/jpeZW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jpeZW.png" alt="plt"></a></p>
  
  <p>I'm finding it hard to believe that two components only account for ~8% of explained variance and these results look odd... I would have thought that PCA works to retain as much variance as possible from the data? Or have I been calculating it wrong?</p>
  
  <p><code>x[0:5]:</code></p>
  
  <pre><code>[[-1.74060e-01 -9.57560e-02  5.95150e-02  3.96730e-02 -3.75934e-01
    -1.15415e-01  9.07250e-02  1.73422e-01  2.92520e-01  1.90375e-01
     9.40910e-02 -1.97482e-01 -1.35202e-01  7.55210e-02  1.10771e-01
     4.79090e-02 -3.91934e-01  7.35480e-02  1.03868e-01 -4.59240e-02
    -9.53400e-03  5.56590e-02 -3.08000e-04  2.15941e-01  8.44760e-02
     6.15730e-02  1.28139e-01  1.84247e-01 -1.00091e-01 -1.26661e-01
    -5.72800e-03 -3.82720e-02  1.80597e-01 -1.55310e-01  5.62320e-02
    -5.92500e-03 -8.53810e-02 -5.69210e-02 -4.55200e-02  2.65116e-01
     9.02210e-02 -2.09879e-01  2.05381e-01  2.36790e-02 -9.29390e-02
     7.27670e-02 -1.05107e-01  1.11120e-02 -1.60518e-01  4.26270e-02
     1.51230e-01 -1.62708e-01 -8.34790e-02 -1.46657e-01  9.13320e-02
     1.09579e-01 -1.01678e-01  9.11980e-02  5.51200e-03  4.73180e-02
     7.81080e-02  2.03824e-01 -1.00126e-01  2.94703e-01 -1.58841e-01
     2.93330e-02  7.82650e-02  1.85240e-02  1.17082e-01  2.12755e-01
    -1.71555e-01  2.94210e-02  1.49264e-01  4.65990e-02 -1.84111e-01
     2.94123e-01 -1.01497e-01 -3.01230e-02 -9.82600e-03  7.83500e-03
    -1.06508e-01 -1.66202e-01 -2.47480e-02 -9.08560e-02  5.69770e-02
     4.76440e-02  1.86180e-02 -3.43760e-02  8.70130e-02 -2.78817e-01
     2.44482e-01  1.59740e-02  1.29030e-02  1.37528e-01  1.38140e-01
     5.47400e-03  7.07190e-02 -1.64084e-01 -1.79274e-01  1.84899e-01]
   [-4.68470e-02  6.17350e-02 -9.39700e-03 -3.21487e-01  1.35940e-02
     1.49780e-02 -7.18690e-02 -1.17625e-01 -1.41148e-01  1.39589e-01
    -9.45150e-02  8.05100e-03  1.79180e-02  7.12750e-02  7.12070e-02
     2.07655e-01 -1.67857e-01 -1.36745e-01 -8.67250e-02 -8.45730e-02
     7.17540e-02  2.13712e-01 -1.42905e-01  1.72995e-01  1.47124e-01
    -1.66269e-01 -1.69885e-01  1.12125e-01 -1.93325e-01 -7.24470e-02
    -1.71490e-02  4.64500e-03  8.49620e-02 -4.38140e-02  4.29490e-02
    -1.68999e-01  1.60550e-02 -5.94520e-02  6.43960e-02  1.77443e-01
     1.69347e-01  1.82960e-02 -3.44550e-02 -2.13336e-01  2.18972e-01
    -1.19635e-01 -5.86050e-02  4.53050e-02  3.17350e-02 -6.87390e-02
     6.33390e-02 -1.52046e-01 -3.90520e-02  7.61900e-03 -2.72430e-02
    -4.35770e-02  1.11760e-02  1.13349e-01  3.61400e-03 -1.33787e-01
     5.33930e-02  2.43900e-01 -1.73750e-02  3.30470e-02 -1.26435e-01
     2.20994e-01  1.36751e-01  7.55210e-02  3.70490e-02  1.03420e-01
    -1.86472e-01 -7.57850e-02  5.51050e-02 -2.03208e-01 -2.43398e-01
     1.16064e-01 -7.72510e-02  4.86940e-02 -2.92860e-02  2.80506e-01
     1.91691e-01 -3.82540e-02  4.93140e-02 -4.55500e-02 -2.66730e-02
     1.02430e-01 -2.89260e-02  1.02755e-01  2.31370e-02 -4.89750e-02
     7.47940e-02 -4.98280e-02 -7.70930e-02 -5.11840e-02 -1.39240e-01
    -2.53120e-02 -5.70250e-02  2.42180e-02 -2.99657e-01  2.67578e-01]
   [-8.39500e-02 -1.01824e-01  1.81731e-01  1.40670e-02 -1.87580e-01
     3.42900e-02 -5.89300e-03  5.36770e-02  8.36230e-02  7.62810e-02
    -3.10600e-02 -1.75981e-01 -6.96800e-02  5.37630e-02  3.73400e-03
    -2.00760e-02 -1.36140e-01 -3.45200e-02  1.49700e-02 -1.17830e-02
     1.06793e-01 -2.83580e-02 -2.97240e-02  1.36660e-02  3.17110e-02
     1.12940e-02  6.95800e-03  8.58400e-03 -5.91890e-02  3.51190e-02
    -6.20280e-02 -1.41275e-01  1.63360e-02 -7.87150e-02  2.49130e-02
     7.65590e-02  3.56440e-02  1.00088e-01 -1.68320e-02  1.70951e-01
    -5.06570e-02  4.01900e-03  1.20666e-01 -3.50180e-02  1.05963e-01
     1.57038e-01 -1.31850e-02 -1.61995e-01 -1.45312e-01 -8.77100e-03
     6.61630e-02 -1.39293e-01  8.08510e-02 -1.01238e-01  1.00171e-01
    -2.15740e-02  5.21600e-03  8.72330e-02  5.83300e-03 -8.70730e-02
     4.70680e-02  1.46379e-01 -5.07890e-02  3.28496e-01 -4.51590e-02
    -2.28540e-02  4.57660e-02  1.04651e-01  4.37010e-02  4.18220e-02
     1.01754e-01 -3.13950e-02  7.72320e-02  7.03310e-02 -1.18943e-01
     4.41870e-02  1.52218e-01  8.59600e-02  2.19597e-01 -9.52670e-02
     3.16670e-02 -1.12022e-01  7.76510e-02 -1.72850e-02 -3.52630e-02
    -5.84850e-02  1.52377e-01  1.38989e-01  8.47150e-02 -2.19000e-02
     1.45324e-01 -2.16640e-01  4.20000e-04  1.62572e-01 -6.87500e-03
     7.32830e-02  7.23580e-02  6.25200e-03 -1.50705e-01  1.90830e-02]
   [-4.92830e-02 -1.13529e-01  4.63170e-02  7.55490e-02 -2.53431e-01
    -1.28370e-02  5.40900e-02  6.77460e-02  2.01792e-01  1.31060e-01
    -5.10200e-02 -1.03544e-01 -5.71250e-02  5.35760e-02 -5.31680e-02
     1.08214e-01 -1.02481e-01 -2.12630e-02  3.54400e-03  6.67380e-02
    -2.23950e-02  3.77230e-02 -2.59860e-02  1.21146e-01  9.54170e-02
     8.16600e-03  1.74307e-01  6.37850e-02 -8.07500e-02 -1.11577e-01
     4.97500e-03 -6.23630e-02  1.84070e-02 -6.68690e-02  6.85410e-02
    -2.38730e-02  6.21030e-02 -3.99490e-02  9.33350e-02  1.46926e-01
    -2.35010e-02 -1.13768e-01  2.67340e-02  5.61810e-02 -4.09180e-02
     1.29777e-01 -7.41130e-02 -8.26530e-02 -5.31730e-02 -2.83570e-02
     1.57710e-01 -1.42213e-01 -6.54910e-02 -8.45030e-02  2.09025e-01
    -1.64135e-01 -6.46500e-03  1.72252e-01  3.20320e-02 -1.55267e-01
    -9.08500e-03  2.01181e-01  2.16680e-02  1.64786e-01 -1.31938e-01
     7.84050e-02  5.32340e-02 -2.56440e-02  2.46850e-02  2.69000e-03
    -4.96370e-02  8.45840e-02  8.18290e-02  1.01170e-02 -6.31440e-02
     1.85050e-01  1.31864e-01  3.59370e-02  8.24870e-02 -1.30290e-02
    -1.23513e-01 -4.67360e-02 -2.54870e-02 -8.89020e-02  1.54840e-02
     3.94370e-02 -7.99840e-02  8.79100e-02 -3.17460e-02 -9.01510e-02
     1.22541e-01 -1.10243e-01  4.65500e-02  1.20022e-01  2.12911e-01
     7.04800e-03  1.27260e-02  1.50930e-02 -8.74320e-02 -1.56960e-02]
   [-8.14410e-02  1.03415e-01  1.54480e-01 -1.13821e-01 -2.59800e-02
    -9.11840e-02  1.98150e-02  6.13800e-03  4.90270e-02  3.57080e-02
    -7.22750e-02 -8.20920e-02  2.53740e-02 -3.39230e-02  1.08040e-02
     2.57740e-02 -9.17830e-02 -1.15800e-03 -3.99410e-02 -8.08910e-02
    -5.23800e-03  8.22700e-03 -5.80400e-02  3.08770e-02  3.06770e-02
    -2.71200e-02  5.21440e-02  6.13250e-02  1.60370e-02  5.94100e-02
    -7.47300e-03 -1.66967e-01 -1.03830e-02 -5.26470e-02  5.42000e-02
     1.37011e-01 -4.50600e-02  5.02110e-02 -3.77980e-02  3.98710e-02
     5.67540e-02  8.18000e-04  2.33870e-02  5.97900e-03  2.37760e-02
     8.12210e-02  9.60000e-03 -7.91730e-02 -3.07628e-01 -3.24800e-03
    -1.21500e-01 -1.31835e-01 -3.74470e-02 -2.80460e-02  1.58474e-01
     3.60790e-02 -6.30950e-02  1.06043e-01 -1.70946e-01  2.19370e-02
    -4.61270e-02  2.44280e-02 -2.40631e-01  1.39449e-01 -1.03286e-01
     6.95440e-02  9.92640e-02  3.34970e-02 -6.07200e-03  7.61150e-02
    -1.13122e-01 -4.28310e-02  1.04957e-01 -7.01560e-02 -1.10580e-01
     6.40850e-02  7.95360e-02  7.02870e-02 -6.11520e-02 -4.34710e-02
     1.92430e-02 -1.34928e-01  9.18830e-02  1.16445e-01  7.33020e-02
    -7.95920e-02  4.32490e-02  1.45400e-03  1.32220e-02 -1.55543e-01
     8.48930e-02 -1.19340e-01  5.97000e-02 -3.51640e-02 -1.36560e-02
    -7.47650e-02 -1.87107e-01 -1.25462e-01 -1.57231e-01  5.17430e-02]]
  </code></pre>