code: private void trainClassifier(int classIndex, Classifier classifier, Instances wekaInstances) throws FOSException {
          wekaInstances.setClassIndex(classIndex == -1 ? wekaInstances.numAttributes() - 1 : classIndex);
  
          try {
              classifier.buildClassifier(wekaInstances);
          } catch (Exception e) {
              throw new FOSException(e.getMessage(), e);
          }
      }
docs: Trains the given {@code classifier} using the given {@link com.feedzai.fos.impl.weka.config.WekaModelConfig modelConfig}
  and {@link weka.core.Instances wekaInstances}.
  
  @param classIndex    The index of the class.
  @param classifier    The classifier to be trained.
  @param wekaInstances The training instances.
  @throws FOSException If it fails to train the classifier.