title: r support vector machine e1071 training not working
body: <p>I am playing around with Support Vector Machines in the R-Language. Specifically I am using the e1071 package.</p>
  
  <p>As long as I follow the manual pages or the tutorial at <a href="http://en.wikibooks.org/wiki/Data_Mining_Algorithms_In_R/Classification/SVM" rel="nofollow">wikibooks</a> everythings works. But if I try to use my own datasets with those examples things aren't that good anymore.</p>
  
  <p>It seems that the model creation fails for some reason. At least I am not getting the levels on the target column. Below you find the example for clarification.</p>
  
  <p>Maybe someone can help me to figure out what I am doing wrong here. So here is all the code and data.</p>
  
  <p><strong>Test dataset</strong></p>
  
  <pre><code>target,col1,col2
  0,1,2
  0,2,3
  0,3,4
  0,4,5
  0,5,6
  0,1,2
  0,2,3
  0,3,4
  0,4,5
  0,5,6
  0,1,2
  0,2,3
  0,3,4
  0,4,5
  1,6,7
  1,7,8
  1,8,9
  1,9,0
  1,0,10
  1,6,7
  1,7,8
  1,8,9
  1,9,0
  1,0,10
  1,6,7
  1,7,8
  1,8,9
  1,9,0
  1,0,10
  </code></pre>
  
  <p><strong>R-Script</strong></p>
  
  <pre><code>library(e1071)
  
  dataset &lt;- read.csv("test.csv", header=TRUE, sep=',')
  
  tuned &lt;- tune.svm(target~., data = dataset, gamma = 10^(-6:-1), cost = 10^(-1:1))
  
  summary(tuned)
  
  model  &lt;- svm(target~., data = dataset, kernel="radial", gamma=0.001, cost=10)
  
  summary(model)
  </code></pre>
  
  <p><strong>Output of the summary(model) statement</strong></p>
  
  <pre><code>+ summary(model)
  
  Call:
  svm(formula = target ~ ., data = dataset, kernel = "radial", gamma = 0.001, 
      cost = 10)
  
  Parameters:
     SVM-Type:  eps-regression 
   SVM-Kernel:  radial 
         cost:  10 
        gamma:  0.001 
      epsilon:  0.1 
  
  Number of Support Vectors:  28
  &gt;
  </code></pre>
  
  <p><strong>Wikibooks examaple</strong></p>
  
  <p>If I compare this output to the output of the wikibooks example, it's missing some information. Please notice the "Levels"-Section in the output:</p>
  
  <pre><code>library(MASS)
  library(e1071)
  data(cats)
  model  &lt;- svm(Sex~., data = cats)
  summary(model)
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>&gt; summary(model)
  
  Call:
  svm(formula = Sex ~ ., data = cats)
  
  Parameters:
     SVM-Type:  C-classification 
   SVM-Kernel:  radial 
         cost:  1 
        gamma:  0.5 
  
  Number of Support Vectors:  84
  
   ( 39 45 )
  
  Number of Classes:  2 
  
  Levels: 
   F M
  </code></pre>