optimize_svm

optimize_svm(kernel_matrix, y, scaling=None, max_iters=500, show_progress=False)[source]

Solving quadratic programming problem for SVM; thus, some constraints are fixed.

Parameters
  • kernel_matrix (ndarray) – NxN array

  • y (ndarray) – Nx1 array

  • scaling (Optional[float]) – the scaling factor to renormalize the y, if it is None, use L2-norm of y for normalization

  • max_iters (int) – number of iterations for QP solver

  • show_progress (bool) – showing the progress of QP solver

Returns

Sx1 array, where S is the number of supports np.ndarray: Sx1 array, where S is the number of supports np.ndarray: Sx1 array, where S is the number of supports

Return type

np.ndarray

Raises

NameError – If cvxpy is not installed