np random seed ( randn ( , np zeros (mpre allocate list for in range ( )if rand (< [ , [ix[ , np absrandn ()) elsex[ , [ix[ , np absrandn ()) vor voronoi (xplt_options {'show_vertices ':false 'show_points ':false 'line_alpha ': fig voronoi_plot_ (vor *plt_options plt plot( [ == , [ == , 'bo' [ == , [ == , 'rs'markersize = support vector machine suppose we are given the training set {(xi yi )}ni= where each response yi takes either the value - or and we wish to construct classifier taking values in {- as this merely involves relabeling of the - classification problem in section the optimal classification function for the indicator loss { }isby theorem equal to if [ / ( - if [ / it is not difficult to showsee exercise that the function gcan be viewed as the minimizer of the risk for the hinge loss functionloss( , ( yb ):max{ yb }over all prediction functions (not necessarily taking values only in the set {- }that isgargmin ( ( )) ( given the training set twe can approximate the risk `(ge ( ( ))with the training loss ( yi (xi ))` (gn = and minimize this over (smallerclass of functions to obtain the optimal prediction function gt finallyas the prediction function gt generally is not classifier by itself (it usually does not only take values - or )we take the classifier sign gt ( the reason why we use responses - and hereinstead of and is that the notation becomes easier hinge loss