1. from sklearn import cross_validation,metrics
    2. from sklearn import svm
    3. clf = svm.SVC(C=5.0)
    4. clf.fit(train_x,train_y)
    5. predict_prob_y = clf.predict_proba(test_x)#基于SVM对验证集做出预测,prodict_prob_y 为预测的概率
    6. #end svm ,start metrics
    7. test_auc = metrics.roc_auc_score(test_y,prodict_prob_y)#验证集上的auc
    8. print test_auc

    ref:https://blog.csdn.net/u010414589/article/details/51166798