<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is possible to apply SVM with proc optmodel? in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417552#M2089</link>
    <description>&lt;P&gt;I saw in&amp;nbsp;&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_qpsolver_overview.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_qpsolver_overview.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 373px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16938i29219211C5498095/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i dont know how can i do it with my data&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 20:31:14 GMT</pubDate>
    <dc:creator>dali74</dc:creator>
    <dc:date>2017-11-30T20:31:14Z</dc:date>
    <item>
      <title>Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417398#M2083</link>
      <description>&lt;P&gt;Hi for all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm seeing powerful of proc optmodel and i would like to resolve svm problem with it.&amp;nbsp; is it possible to resolve support vector machine with it? Like this problem&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 238px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16932i917A811912205B9B/image-dimensions/238x180?v=v2" width="238" height="180" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Suppose we have two vars linearly separable, I know proc svm can do it.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 13:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417398#M2083</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-30T13:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417441#M2084</link>
      <description>&lt;P&gt;PROC OPTMODEL doesn't has a SVM algorithm. It has transitive closure, shortest path, minimum cost network flow, minimum spanning tree, minimum cut, TSP, among others, but not SVM. For SVM you need to use Enterprise Miner&amp;nbsp;or Viya VDMML.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417441#M2084</guid>
      <dc:creator>carpdr</dc:creator>
      <dc:date>2017-11-30T15:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417443#M2085</link>
      <description>&lt;P&gt;Although PROC OPTMODEL does not have anything built-in for SVM, you can formulate the quadratic programming (QP) problem and call the QP solver.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417443#M2085</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-11-30T15:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417463#M2086</link>
      <description>&lt;P&gt;Suposse we have this data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; X1	          X2            y
0.49922066	0.834590569	-1
-0.509598752	0.865356638	-1
-0.313012311	-0.54000741	-1
0.713675823	0.094540165	-1
-1.05062909	-0.493905705	-1
1.326427551	1.400617167	1
0.688668461	1.385509561	1
2.705730511	1.526311825	1
2.335457445	-0.497797479	1
-1.340637901	2.205443013	1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can we apply proc optmodel?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 16:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417463#M2086</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-30T16:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417468#M2087</link>
      <description>&lt;P&gt;You right Rob. I was thinking about OPTNET.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 16:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417468#M2087</guid>
      <dc:creator>carpdr</dc:creator>
      <dc:date>2017-11-30T16:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417552#M2089</link>
      <description>&lt;P&gt;I saw in&amp;nbsp;&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_qpsolver_overview.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_qpsolver_overview.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 373px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16938i29219211C5498095/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i dont know how can i do it with my data&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 20:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417552#M2089</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-30T20:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417556#M2090</link>
      <description>&lt;P&gt;Here's a simple way to do it.&amp;nbsp; I included plots because you have two-dimensional data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let n = 2;
data indata;
   input X1 X2 y;
   datalines;
0.49922066	0.834590569	-1
-0.509598752	0.865356638	-1
-0.313012311	-0.54000741	-1
0.713675823	0.094540165	-1
-1.05062909	-0.493905705	-1
1.326427551	1.400617167	1
0.688668461	1.385509561	1
2.705730511	1.526311825	1
2.335457445	-0.497797479	1
-1.340637901	2.205443013	1
;

proc sgplot data=indata;
   scatter x=x1 y=x2 / group=y;
run;

proc optmodel;
   /* read input */
   set OBS;
   num n = &amp;amp;n;
   num x {OBS, 1..n}, y {OBS};
   read data indata into OBS=[_N_] {j in 1..n} &amp;lt;x[_N_,j]=col('x'||j)&amp;gt; y;

   /* declare optimization model */
   var W {1..n};
   var B;
   min Z = 0.5 * sum {j in 1..n} W[j]^2;
   con Separate {i in OBS}:
      y[i] * (sum {j in 1..n} x[i,j]*W[j] - B) &amp;gt;= 1;

   /* call QP solver */
   solve;

   /* plot output */
   num slope = -W[1].sol/W[2].sol;
   num intercept = B.sol/W[2].sol;
   submit slope intercept;
      proc sgplot data=indata;
         scatter x=x1 y=x2 / group=y;
         lineparm x=0 y=&amp;amp;intercept slope=&amp;amp;slope / lineattrs=(pattern=dash color=black);
      run;
   endsubmit;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="svm.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16940i211E2F00BB8571CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="svm.png" alt="svm.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 20:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417556#M2090</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-11-30T20:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417567#M2092</link>
      <description>&lt;P&gt;It seems this data is not related to optimization problem, such as minimize or maximize y. It seems to be a very traditional classification problem, and then you should use the traditional SVM algorithm.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 21:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417567#M2092</guid>
      <dc:creator>carpdr</dc:creator>
      <dc:date>2017-11-30T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417568#M2093</link>
      <description>&lt;P&gt;I just saw Rob has replied the code for proc optmodel.&lt;/P&gt;
&lt;P&gt;Here is the code for proc svm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; x1x2y;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; x1 x2 y;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;0.49922066 0.834590569 -1&lt;/P&gt;
&lt;P&gt;-0.509598752 0.865356638 -1&lt;/P&gt;
&lt;P&gt;-0.313012311 -0.54000741 -1&lt;/P&gt;
&lt;P&gt;0.713675823 0.094540165 -1&lt;/P&gt;
&lt;P&gt;-1.05062909 -0.493905705 -1&lt;/P&gt;
&lt;P&gt;1.326427551 1.400617167 1&lt;/P&gt;
&lt;P&gt;0.688668461 1.385509561 1&lt;/P&gt;
&lt;P&gt;2.705730511 1.526311825 1&lt;/P&gt;
&lt;P&gt;2.335457445 -0.497797479 1&lt;/P&gt;
&lt;P&gt;-1.340637901 2.205443013 1&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;dmdb&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; batch&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;data=x1x2y&lt;/P&gt;
&lt;P&gt;dmdbcat=_cat&lt;/P&gt;
&lt;P&gt;out=_x1x2y;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; x1 x2;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; y;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;svm&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;data=_x1x2y&lt;/P&gt;
&lt;P&gt;dmdbcat=_cat&lt;/P&gt;
&lt;P&gt;kernel=polynom&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; c=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; k_par=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; x1 x2;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="2"&gt;target&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; y;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;and the results:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="100%" class="systitleandfootercontainer" border="0" rules="none" frame="void" cellspacing="1" cellpadding="1" summary="Page Layout"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c systemtitle"&gt;The SAS System&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="c proctitle"&gt;The SVM Procedure&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="proctitle"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c proctitle"&gt;---Start Training: Technique= FQP---&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="proctitle"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c proctitle"&gt;Bias -0.163379279 Applied on Predicted Values&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;A name="IDX7" target="_blank"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;TABLE width="100%" class="systitleandfootercontainer" border="0" rules="none" frame="void" cellspacing="1" cellpadding="1" summary="Page Layout"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c systemtitle"&gt;The SAS System&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="c proctitle"&gt;The SVM Procedure&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure SVM: AccTab"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Classification Table (Training Data)&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Misclassification=0 Accuracy= 100.00&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" rowspan="2" scope="col"&gt;Observed&lt;/TH&gt;
&lt;TH class="c b header" colspan="3" scope="colgroup"&gt;Predicted&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;-1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Missing&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;-1&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;5.0000&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;1&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;5.0000&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Missing&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="page-break-after: always;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR size="3" /&gt;
&lt;P&gt;&lt;A name="IDX8" target="_blank"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;TABLE width="100%" class="systitleandfootercontainer" border="0" rules="none" frame="void" cellspacing="1" cellpadding="1" summary="Page Layout"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c systemtitle"&gt;The SAS System&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="c proctitle"&gt;The SVM Procedure&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure SVM: ResTab"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Support Vector Classification&lt;/TH&gt;
&lt;TD class="r data"&gt;C_CLAS&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Kernel Function&lt;/TH&gt;
&lt;TD class="r data"&gt;Polynomial&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Kernel Function Parameter 1&lt;/TH&gt;
&lt;TD class="r data"&gt;2.000000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Estimation Method&lt;/TH&gt;
&lt;TD class="r data"&gt;FQP&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Observations (Train)&lt;/TH&gt;
&lt;TD class="r data"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Effects&lt;/TH&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Regularization Parameter C&lt;/TH&gt;
&lt;TD class="r data"&gt;1.000000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Classification Error (Training)&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Objective Function&lt;/TH&gt;
&lt;TD class="r data"&gt;-2.925242&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Inf. Norm of Gradient&lt;/TH&gt;
&lt;TD class="r data"&gt;9.436896E-16&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Squared Euclidean Norm of w&lt;/TH&gt;
&lt;TD class="r data"&gt;2.983253&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Geometric Margin&lt;/TH&gt;
&lt;TD class="r data"&gt;1.157937&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Support Vectors&lt;/TH&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of S.Vector on Margin&lt;/TH&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Bias&lt;/TH&gt;
&lt;TD class="r data"&gt;-0.163379&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Norm of Longest Vector&lt;/TH&gt;
&lt;TD class="r data"&gt;3.000000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Radius of Sphere Around SV&lt;/TH&gt;
&lt;TD class="r data"&gt;2.407486&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Estimated VC Dim of Classifier&lt;/TH&gt;
&lt;TD class="r data"&gt;18.290903&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;KT Threshold&lt;/TH&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Kernel Calls&lt;/TH&gt;
&lt;TD class="r data"&gt;189&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 21:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417568#M2093</guid>
      <dc:creator>carpdr</dc:creator>
      <dc:date>2017-11-30T21:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417591#M2094</link>
      <description>&lt;P&gt;dont we use linear kernel?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 22:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417591#M2094</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-30T22:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417597#M2095</link>
      <description>&lt;P&gt;you can... kernel-linear&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;results are not as good as kernel=polynom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure SVM: AccTab"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Classification Table (Training Data)&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Misclassification=1 Accuracy= 90.00&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" rowspan="2" scope="col"&gt;Observed&lt;/TH&gt;
&lt;TH class="c b header" colspan="3" scope="colgroup"&gt;Predicted&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;-1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Missing&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;-1&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;4.0000&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;1.0000&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;1&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;5.0000&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l data"&gt;Missing&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TH class="r rowheader" scope="row"&gt;0&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Nov 2017 22:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417597#M2095</guid>
      <dc:creator>carpdr</dc:creator>
      <dc:date>2017-11-30T22:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417620#M2096</link>
      <description>&lt;P&gt;if we have non-separable data, how can we modify our problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16945i26860B1B43E22FD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 23:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417620#M2096</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-30T23:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417794#M2097</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   num c = 1e4;
   var W {1..n};
   var B;
   var E {OBS} &amp;gt;= 0;
   min Z = 0.5 * sum {j in 1..n} W[j]^2 + c * sum {i in OBS} E[i];
   con Separate {i in OBS}:
      y[i] * (sum {j in 1..n} x[i,j]*W[j] - B) &amp;gt;= 1 - E[i];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The choice of c is up to you.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 16:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417794#M2097</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-01T16:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417829#M2098</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Its easy to see how we can classify obs in 2d graph, but if we have five variables (5d), we cant paint it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then how can i see how classify my model? for future obs? I know qe can solve this problem with this code but i dont know how translate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let n = 5;
data indata;
input x1 x2 x3 x4 x5 y @@;
datalines;
3.435937542	1.910389226	0.276850846	0.364419827	0.140722091	1
1.752885649	1.190057355	0.599295002	0.227447953	0.815532861	1
1.621776734	1.179003553	0.760496315	0.624320514	0.230451018	1
2.575575289	2.999259474	0.620989763	0.828880959	0.034141306	1
1.568690442	1.864722267	0.410446021	0.977573713	0.837272457	1
2.008282532	2.035882912	0.967093924	0.725730786	0.528795923	1
3.150476337	-0.211155573 0.633565936	0.767706516	0.274370632	1
2.412125188	2.459121555	0.40247943	0.205630191	0.303806821	1
2.886648426	1.458100781	0.661861202	0.822914202	0.314037231	1
2.832672695	3.166103391	0.635750146	0.415985331	0.518241769	1
5.435937542	3.910389226	0.220233529	0.909811353	0.611028911	-1
3.752885649	3.190057355	0.090459485	0.686435643	0.218221874	-1
3.621776734	3.179003553	0.797479778	0.201698903	0.062966533	-1
4.575575289	4.999259474	0.344128219	0.054420354	0.009042683	-1
3.568690442	3.864722267	0.748489181	0.989565182	0.4580315	-1
4.008282532	4.035882912	0.460437955	0.287010879	0.200715865	-1
5.150476337	1.788844427	0.155870021	0.000179874	0.993454689	-1
4.412125188	4.459121555	0.543481598	0.639162032	0.571248807	-1
4.886648426	3.458100781	0.400991393	0.274163115	0.118862113	-1
4.832672695	5.166103391	0.333071111	0.391013648	0.446375253	-1

;
run;

proc optmodel;
 /* read input */
 set OBS;
 num n = &amp;amp;n;
 num x {OBS, 1..n}, y {OBS};
 read data indata into OBS=[_N_] {j in 1..n} &amp;lt;x[_N_,j]=col('x'||j)&amp;gt; y;

 /* declare optimization model */
 var W {1..n};
 var B;
 min Z = 0.5 * sum {j in 1..n} W[j]^2;
 con Separate {i in OBS}:
 y[i] * (sum {j in 1..n} x[i,j]*W[j] - B) &amp;gt;= 1;

 /* call QP solver */
 solve;
 quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 19:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417829#M2098</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-12-01T19:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417843#M2099</link>
      <description>&lt;P&gt;You can use the SIGN function to compute on which side of the hyperplane the point lies:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   /* create output */
   create data outdata(drop=i) from [i] {j in 1..n} &amp;lt;col('x'||j)=x[i,j]&amp;gt; y 
      yhat=(sign(sum {j in 1..n} x[i,j]*W[j] - B));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 20:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417843#M2099</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-12-01T20:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is possible to apply SVM with proc optmodel?</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417911#M2100</link>
      <description>&lt;P&gt;&amp;nbsp;I think you showed all details about solving svm as quadratic programing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My last question is if we have non-linear case, how we should transform the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;thank you very much about your help!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 01:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Is-possible-to-apply-SVM-with-proc-optmodel/m-p/417911#M2100</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-12-02T01:25:05Z</dc:date>
    </item>
  </channel>
</rss>

