Skip to content

Instantly share code, notes, and snippets.

@ImadDabbura
Created August 3, 2018 20:37
Show Gist options
  • Save ImadDabbura/aff23eaab552c0d600374bb25e337a97 to your computer and use it in GitHub Desktop.
Save ImadDabbura/aff23eaab552c0d600374bb25e337a97 to your computer and use it in GitHub Desktop.
# Build SVM classifier
clf_svc = make_pipeline(StandardScaler(),
SVC(C=0.01,
gamma=0.1,
kernel="poly",
degree=5,
coef0=10,
probability=True))
clf_svc.fit(X_train, y_train)
svc_cv_scores = cross_val_score(clf_svc,
X=X_train,
y=y_train,
scoring="f1",
cv=10,
n_jobs=-1)
# Print CV
print(f"\033[1m\033[94mThe 10-folds CV f1-score is: {np.mean(svc_cv_scores) * 100:.2f}%")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment