@Override
  public void setup(Context context) {

    this.context = context;

    classIndex = ClassIndex.getInstance();

    Configuration conf = context.getConfiguration();

    float threshold = conf.getFloat(Util.CONF_MINIMUM_DF_OF_HOSTS, 0);

    try {

      Path headerPath = new Path(conf.get(Util.CONF_HEADER_PATH));

      LOG.info("Reading dataset header..." + headerPath.toString());

      header = new DataSetHeader(conf, headerPath);
      if (!classIndex.isPopulated()) {
        classIndex.init(conf);
        classIndex.populateIndex();
      }
      if (threshold > 0.0) {
        LOG.info("loading DF values");
        hostsWithMinimumDF = Util.getHostsWithDocumentFrequencies(conf, threshold);
      }

      LOG.info("loading training data...");

      loadTrainingInstances(conf.get(Util.CONF_TRAINING_DATE));

    } catch (Exception e) {
      LOG.error("setup failed with an exception!");
      e.printStackTrace();
      setupFailedException = e;
    }
  }