title: Java Weka: How to specify split percentage?
body: <p>I have written the code to create the model and save it. It works fine. My understanding is data, by default, is split in 10 folds. I want data to be split into two sets (training and testing) when I create the model. On Weka UI, I can do it by using "Percentage split" radio button. I want to know how to do it through code. I want it to be split in two parts 80% being the training and 20% being the testing. Here is my code.</p>
  
  <pre><code>        FilteredClassifier model = new FilteredClassifier();
          model.setFilter(new StringToWordVector());
          model.setClassifier(new NaiveBayesMultinomial());
          try {
              model.buildClassifier(trainingSet);
          } catch (Exception e1) { // TODO Auto-generated catch block
              e1.printStackTrace();
          }
  
          ObjectOutputStream oos = new ObjectOutputStream(
                  new FileOutputStream(
                          "/Users/me/models/MyModel.model"));
          oos.writeObject(model);
          oos.flush();
          oos.close();
  </code></pre>
  
  <p>trainingSet here is already populated Instances object. Can someone help me with this?</p>
  
  <p>Thanks in advance!</p>