Skip to content

Instantly share code, notes, and snippets.

View Midhilesh4890's full-sized avatar

Midhilesh Momidi Midhilesh4890

View GitHub Profile
@Midhilesh4890
Midhilesh4890 / compare-svm-kernels.py
Created October 15, 2020 08:24 — forked from WittmannF/compare-svm-kernels.py
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