Skip to content

Instantly share code, notes, and snippets.

@FedericoV
Created June 17, 2016 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FedericoV/ba17ff6146a56fefef9e6964ca3c0338 to your computer and use it in GitHub Desktop.
Save FedericoV/ba17ff6146a56fefef9e6964ca3c0338 to your computer and use it in GitHub Desktop.
for train_idx, test_idx in cv:
X_train, y_train = X[train_idx], y[train_idx]
X_test, y_test = X[test_idx], y[test_idx]
pip.fit(X_train, y_train)
y_pred = pip.predict(X_test)
print (roc_auc_score(y_test, y_pred))
0.70326179109
0.702470985203
0.704665014308
0.698426180489
vs:
score_saga_l1 = cross_validation.cross_val_score(
pip, X, y, cv=cv, n_jobs=5, scoring='roc_auc')
print (score_saga_l1)
[ 0.78036929 0.77716077 0.78371017 0.77667738 0.78177823]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment