Created
February 22, 2012 11:45
-
-
Save mekman/1884451 to your computer and use it in GitHub Desktop.
This file contains 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
import numpy as np | |
from sklearn.cross_validation import permutation_test_score | |
from sklearn.metrics import zero_one_score | |
from sklearn.svm import SVC | |
from sklearn.cross_val import StratifiedKFold, cross_val_score | |
import cPickle | |
Y=np.loadtxt('Y.txt') | |
file=open('wired_data.dat','rb') | |
X=cPickle.load(file) | |
clf = SVC(kernel='linear', C=1.) | |
cv = StratifiedKFold(Y, 11) | |
# works fine | |
cv_scores, permutation_scores, pval = permutation_test_score(clf, X, Y, zero_one_score, cv=cv, n_permutations=50, n_jobs=4,verbose=1, random_state=0) | |
# does not finish | |
cv_scores, permutation_scores, pval = permutation_test_score(clf, X, Y, zero_one_score, cv=cv, n_permutations=200, n_jobs=4,verbose=1, random_state=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment