import pandas as pd
from sklearn.cross_validation import StratifiedKFold
from sklearn.feature_selection import SelectPercentile
a = pd.read_csv('NCAA_2003-2016_with_diff.csv')
logreg = lm.LogisticRegression()
rfecv = RFECV(estimator=logreg, cv=10, scoring='?')
有914行* 191列,例如:
x = df[['diff_dist','team1_log5','tpp','orp','tempo','efg','ftr','blk']]
y = df[['result']]
这意味着还有其他'x',我尝试选择最有效的变量来预测结果。
如何编写for循环来执行此操作?