Skip to main content
. Author manuscript; available in PMC: 2012 Sep 30.
Published in final edited form as: J Neurosci Methods. 2011 Jul 27;201(1):196–203. doi: 10.1016/j.jneumeth.2011.06.027

Algorithm 3.

(Training and prediction with the support vector machine classifier)

Training (model generation) stage
 1. Initialize w = 0
 2. Find w as solution of optimization problem
min ∥w∥ subject to (yi(xiTw)1ξξi0,ξiC(constant)).
where ξ’s are slack variables of optimization problem (in non-separable case).
Prediction (testing) stage
 1. Compute wTx
 2. Predict y = sign(wTx)