title: Principal Component Analysis: Order of components AFTER transformation
body: <p>I am using the <code>PCA</code> class from <code>sklearn.decomposition</code> to reduce the dimensionality of the feature space in order to plot that feature space.</p>
  <p>I wondering the following: After applying the <code>fit</code> and <code>transform</code> method of the <code>PCA</code> class, I am getting back an array <code>X_transformed</code> of shape <code>(n_samples, n_components)</code> as stated in the <a href="https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA.transform" rel="nofollow noreferrer">documentation</a>. Is the order of columns of <code>X_transformed</code> sorted by the amount of explained variance? In the documentation it says that <code>PCA.components_</code> is sorted by explained variance, so I am assuming that the columns of <code>X_transformed</code> are as well, but please correct me if I am wrong.</p>
  <p>Little example:</p>
  <pre class="lang-py prettyprint-override"><code>from sklearn.decomposition import PCA
  
  
  pca = PCA()
  pca.fit(X) # X is an array containing my original features. X.shape=(n_samples, n_features)
  X_transformed = pca.transfom(X) # X_transformed.shape=(n_samples, n_components). Are X_transformed's columns sorted by explained variance?
  </code></pre>
  <p>Thanks!</p>