Skip to content

Instantly share code, notes, and snippets.

@EXJUSTICE
Last active April 5, 2020 19:54
Show Gist options
  • Save EXJUSTICE/c56101d1eef1627121164e5aceff0d5a to your computer and use it in GitHub Desktop.
Save EXJUSTICE/c56101d1eef1627121164e5aceff0d5a to your computer and use it in GitHub Desktop.
total_combinations = generateCombinations(features,number_per_combination)
for feature_combination in total_combinations:
X = data[list(feature_combination)]
sc_X = StandardScaler()
df = sc_X.fit_transform(X)
clf =LogisticRegression()
clf.fit(df,y)
train_score = clf.score(df,y)
if(train_score.mean()>0.8):
X = data[list(feature_combination)]
sc_X = StandardScaler()
df = sc_X.fit_transform(X)
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