Created
October 28, 2020 19:46
-
-
Save 3catz/6545aad3cb8c63517ab4af4526ffb9db to your computer and use it in GitHub Desktop.
Vetting of GA feature subsets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scores = [] | |
for i in range(len(report)): | |
myfeats = report.iloc[i,1] ; print(myfeats) | |
X = D[myfeats] ; y = y | |
clf = LogisticRegression(solver = "liblinear", C = 6, tol = 1) | |
#clf = RandomForestClassifier() | |
rskf = RepeatedStratifiedKFold(n_splits = 10, n_repeats = 100) | |
score = np.mean(cross_val_score(clf, X, y, cv = rskf, scoring = "roc_auc")) | |
scores.append(score) | |
print("Score This Round", score) | |
print("-------------------") | |
for i in range(len(scores)): | |
if scores[i] == np.max(scores): | |
print("Max Score", scores[i]); print("Features:", report.iloc[i,1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment