Skip to content

Instantly share code, notes, and snippets.

View anas-elghafari's full-sized avatar

Anas Elghafari anas-elghafari

View GitHub Profile
@WittmannF
WittmannF / compare-svm-kernels.py
Last active July 5, 2024 15:02
Visualization of SVM Kernels Linear, RBF, Poly and Sigmoid on Python (Adapted from: http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.datasets import make_moons, make_circles, make_classification
from sklearn.svm import SVC
h = .02 # step size in the mesh