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 arrayy (
ndarray
) – Nx1 arrayscaling (
Optional
[float
]) – the scaling factor to renormalize the y, if it is None, use L2-norm of y for normalizationmax_iters (
int
) – number of iterations for QP solvershow_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