docs: private void train(String resource, int classindex)
  	{
          try
          {
              //analyze the path
              InputStream is;
              if (resource.startsWith("res:"))
                  is = getClass().getResourceAsStream("/" + resource.substring(4));
              else
                  is = new FileInputStream(resource);
  
              if (is == null)
              {
                  log.error("Couldn't open training file {}", resource);
                  return;
              }
              
              //open the data file
              DataSource source = new DataSource(is);
              Instances tdata = source.getDataSet();
              tdata.setClassIndex(classindex);
              
              //initialize the filter
              System.err.print("filter...");
              filter = new weka.filters.unsupervised.attribute.Standardize();
              //filter = new weka.filters.unsupervised.attribute.Normalize();
              //filter.setInputFormat(tdata);
              
              //filter = new weka.filters.unsupervised.attribute.Remove();
              //((weka.filters.unsupervised.attribute.Remove) filter).setAttributeIndices("1,25"); //do not include ID and MARKEDNESS
              //filter.setInputFormat(tdata);
              //trainset = Filter.useFilter(tdata, remove);
              trainset = tdata;
              
              //build the classifier
              System.err.print("build...");
              //AbstractClassifier cls = new weka.classifiers.bayes.NaiveBayes();
              //AbstractClassifier cls = new weka.classifiers.functions.MultilayerPerceptron();
              //cls.setOptions(weka.core.Utils.splitOptions("-L 0.3 -M 0.2 -N 500 -V 0 -S 0 -E 20 -H a"));
              AbstractClassifier cls = new weka.classifiers.trees.J48();
              cls.setOptions(weka.core.Utils.splitOptions("-C 0.25 -M 2"));
              //AbstractClassifier cls = new weka.classifiers.functions.LibSVM();
              //cls.setOptions(weka.core.Utils.splitOptions("-S 0 -K 2 -D 3 -G 0.5 -R 0.0 -N 0.5 -M 40.0 -C 128.0 -E 0.0010 -P 0.1"));
              
              FilteredClassifier fc = new FilteredClassifier();
              fc.setFilter(filter);
              fc.setClassifier(cls);
              
              classifier = fc;
              classifier.buildClassifier(trainset);
              
              if (cls instanceof weka.classifiers.trees.J48)
                  System.out.println(((weka.classifiers.trees.J48) cls).toString());
              
              is.close();
              
          } catch (Exception e) {
              classifier = null;
              log.error("Classifier training failed: " + e.getMessage());
              e.printStackTrace();
          }
  	}