Factor Investing, Dimensionality Reduction, Sklearn, Python.
df_rank.iloc[:,:10].fillna(df_rank.iloc[:-5000,:-10].mean()),df_rank["Outperform"].iloc[:-5000] X_test, y_test = df_rank.iloc[:,:10].fillna(df_rank.iloc[-5000:,:-10].mean()), df_rank["Outperform"].iloc[-5000:] pca = PCA() pca.fit(X_train) cumsum = np.cumsum(pca.explained_variance_ratio_) d =