X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
clf = svm.SVC(kernel='rbf', gamma=0.7, C=1.0).fit(X_train, y_train)
How to calculate precision, recall and F-score with libSVM in python