from sklearn import cross_validation,metrics
from sklearn import svm
clf = svm.SVC(C=5.0)
clf.fit(train_x,train_y)
predict_prob_y = clf.predict_proba(test_x)#基于SVM对验证集做出预测,prodict_prob_y 为预测的概率
#end svm ,start metrics
test_auc = metrics.roc_auc_score(test_y,prodict_prob_y)#验证集上的auc值
print test_auc
ref:https://blog.csdn.net/u010414589/article/details/51166798