Skip to content

Instantly share code, notes, and snippets.

@mblondel
mblondel / svm.py
Last active September 10, 2024 08:11
Support Vector Machines
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)