title: How to Interpret Predict Result of SVM in R?
body: <p>I'm new to R and I'm using the <code>e1071</code> package for SVM classification in R.</p>
  
  <p>I used the following code:</p>
  
  <pre><code>data &lt;- loadNumerical()
  
  model &lt;- svm(data[,-ncol(data)], data[,ncol(data)], gamma=10)
  
  print(predict(model, data[c(1:20),-ncol(data)]))
  </code></pre>
  
  <p>The <code>loadNumerical</code> is for loading data, and the data are of the form(first 8 columns are input and the last column is classification) :</p>
  
  <pre><code>   [,1] [,2] [,3] [,4] [,5] [,6] [,7]      [,8] [,9]
  1    39    1   -1   43   -1    1    0 0.9050497    0
  2    23   -1   -1   30   -1   -1    0 1.6624974    1
  3    50   -1   -1   49    1    1    2 1.5571429    0
  4    46   -1    1   19   -1   -1    0 1.3523685    0
  5    36    1    1   29   -1    1    1 1.3812029    1
  6    27   -1   -1   19    1    1    0 1.9403649    0
  7    36   -1   -1   25   -1    1    0 2.3360004    0
  8    41    1    1   23    1   -1    1 2.4899738    0
  9    21   -1   -1   18    1   -1    2 1.2989637    1
  10   39   -1    1   21   -1   -1    1 1.6121595    0
  </code></pre>
  
  <p>The number of rows in the data is 500.</p>
  
  <p>As shown in the code above, I tested the first 20 rows for prediction. And the output is:</p>
  
  <pre><code>         1          2          3          4          5          6          7 
  0.04906014 0.88230392 0.04910760 0.04910719 0.87302217 0.04898187 0.04909523 
           8          9         10         11         12         13         14 
  0.04909199 0.87224979 0.04913189 0.04893709 0.87812890 0.04909588 0.04910999 
          15         16         17         18         19         20 
  0.89837037 0.04903778 0.04914173 0.04897789 0.87572114 0.87001066 
  </code></pre>
  
  <p>I can tell intuitively from the result that when the result is close to 0, it means 0 class, and if it's close to 1 it's in the 1 class.</p>
  
  <p>But my question is how can I <strong>precisely</strong> interpret the result: is there a threshold <em>s</em> I can use so that values below <em>s</em> are classified as 0 and values above <em>s</em> are classified as 1 ?</p>
  
  <p>If there exists such <em>s</em>, how can I derive it ?</p>