Skip to content

Instantly share code, notes, and snippets.

@EXJUSTICE
Created April 18, 2020 15:55
Show Gist options
  • Save EXJUSTICE/18f475d801dbd63df770123f1bce8cdb to your computer and use it in GitHub Desktop.
Save EXJUSTICE/18f475d801dbd63df770123f1bce8cdb to your computer and use it in GitHub Desktop.
finalfeatureholder = []
CVMRscoreholder = []
CVMRstdholder= []
total_combinations = generateCombinations(features,number_per_combination)
for feature_combination in total_combinations:
X = data[list(feature_combination)]
clf =LogisticRegression()
clf.fit(X,y)
train_score = clf.score(X,y)
if(train_score.mean()>0.8):
X = data[list(feature_combination)]
clf =LogisticRegression()
cross_validation_score= cross_val_score(clf, X, y, cv=7)
if(cross_validation_score.mean()>0.7):
finalfeatureholder.append(str(feature_combination))
scoreholder.append(str(train_score.mean()))
CVMRscoreholder.append(str(cross_validation_score.mean()))
CVMRstdholder.append(str(cross_validation_score.std()*2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment