title: Cannot handle numeric attribute weka svm
body: <p>I have been trying to use MISVM of Standford Weka. But I keep getting the Error</p>
  
  <p><code>weka.classifiers.mi.MISVM: Cannot handle numeric attributes!</code></p>
  
  <p><strong>My Training Set File(file.arff)</strong></p>
  
  <pre><code>@relation 'SpamDetectionTrainingSet'
  @attribute 'checkin' real
  @attribute 'tips' real
  @attribute 'badges' real
  @attribute 'friends' real
  @attribute 'mayors' real
  @attribute 'lists' real
  @attribute 'target' {'spam','nonspam'}
  @data
  1165,36,1,1,4,47,nonspam
  8521,492,620,7,74,144,nonspam
  5408,189,306,0,27,121,nonspam
  0,43,319,0,0,0,spam
  </code></pre>
  
  <p>I have seen the solutions of previous questions. One Main point, I observed from them was to keep the <code>target attribute</code> nominal. My target attributes are nominal only</p>
  
  <p><strong>My SOURCE CODE</strong></p>
  
  <pre><code>import weka.core.Instances;
  import weka.core.Utils;
  import weka.core.converters.ConverterUtils.DataSink;
  import weka.core.converters.ConverterUtils.DataSource;
  public class SVM 
  {
      /* Read the Data in ARFF format */
      DataSource train,unknown,test;
      Instances trainData,unknownData;
      public SVM()
      {
          try {
              /* Loading the Data */
              train       = new DataSource("/home/hduser/file.arff");
              trainData   = train.getDataSet();
              trainData.setClassIndex(trainData.numAttributes()-1);
  
              /* Set Option for SVM Algorithm */
              String[] opt = Utils.splitOptions("-N 1 -D");
  
              /*Training */
              weka.classifiers.mi.MISVM rf = new weka.classifiers.mi.MISVM();
  
              rf.setOptions(opt);
              System.out.println(rf.getFilterType());
  
              rf.buildClassifier(trainData);
  
              /* Classify Users */
              unknown     = new DataSource("/home/hduser/fileTest1.arff");
              unknownData = unknown.getDataSet();
              unknownData.setClassIndex(unknownData.numAttributes()-1);
  
              Instances copy = new Instances(unknownData);
  
              for(int i=0;i&lt;unknownData.numInstances();i++)
              {
                  System.out.println("Hello ");
                  double value = rf.classifyInstance(unknownData.instance(i));
                  copy.instance(i).setClassValue(value);
              }
  
              DataSink.write("/home/hduser/output1.arff", copy);
          } 
          catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
      public static void main(String[] args)
      {
          SVM r = new SVM();
      }
  }
  </code></pre>
  
  <p><strong>COMPLETE ERROR MESSAGE :</strong></p>
  
  <pre><code>weka.core.UnsupportedAttributeTypeException: weka.classifiers.mi.MISVM: Cannot handle numeric attributes!
      at weka.core.Capabilities.test(Capabilities.java:954)
      at weka.core.Capabilities.test(Capabilities.java:869)
      at weka.core.Capabilities.test(Capabilities.java:1085)
      at weka.core.Capabilities.test(Capabilities.java:1023)
      at weka.core.Capabilities.testWithFail(Capabilities.java:1302)
      at weka.classifiers.mi.MISVM.buildClassifier(MISVM.java:607)
      at SVM.&lt;init&gt;(SVM.java:28)
      at SVM.main(SVM.java:53)
  </code></pre>