Factor Investing, Dimensionality Reduction, Sklearn, Python.
‘mle’, this class uses the method from: Minka, T. P.. “Automatic choice of dimensionality for PCA”. In NIPS, pp. 598–604 from sklearn.decomposition import PCA X = df_rank.iloc[:,:10].fillna(df_rank.iloc[:,:10].mean()) pca = PCA(n_components=2) X2D = pca.fit_transform(X) With Scikit-Learn, PCA is