Program: 33079
Project: 33079
Buggy source:
static void trainModel(Config config,ClfDataSet dataSet,FeatureMappers featureMappers,ESIndex index,IdTranslator trainIdTranslator) throws Exception {
  String archive=config.getString("String_Node_Str");
  int numIterations=config.getInt("String_Node_Str");
  int numClasses=config.getInt("String_Node_Str");
  int numLeaves=config.getInt("String_Node_Str");
  double learningRate=config.getDouble("String_Node_Str");
  int trainMinDataPerLeaf=config.getInt("String_Node_Str");
  String modelName=config.getString("String_Node_Str");
  boolean overwriteModels=config.getBoolean("String_Node_Str");
  int numDocsToSelect=config.getInt("String_Node_Str");
  int numNgramsToExtract=config.getInt("String_Node_Str");
  double extractionFrequency=config.getDouble("String_Node_Str");
  if (extractionFrequency > 1 || extractionFrequency < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Map<Integer,String> labelMap=dataSet.getSetting().getLabelMap();
  StopWatch stopWatch=new StopWatch();
  stopWatch.start();
  System.out.println("String_Node_Str");
  LKTBConfig trainConfig=new LKTBConfig.Builder(dataSet).learningRate(learningRate).minDataPerLeaf(trainMinDataPerLeaf).numLeaves(numLeaves).build();
  LKTreeBoost lkTreeBoost=new LKTreeBoost(numClasses);
  lkTreeBoost.setPriorProbs(dataSet);
  lkTreeBoost.setTrainConfig(trainConfig);
  TermSplitExtractor splitExtractor=new TermSplitExtractor(index,trainIdTranslator,numNgramsToExtract).setMinDataPerLeaf(config.getInt("String_Node_Str"));
  TermTfidfExtractor tfidfExtractor=new TermTfidfExtractor(index,trainIdTranslator,numNgramsToExtract).setMinDf(config.getInt("String_Node_Str"));
  TermTfidfSplitExtractor tfidfSplitExtractor=new TermTfidfSplitExtractor(index,trainIdTranslator,numNgramsToExtract).setMinDf(config.getInt("String_Node_Str")).setNumSurvivors(config.getInt("String_Node_Str")).setMinDataPerLeaf(config.getInt("String_Node_Str"));
  PhraseSplitExtractor phraseSplitExtractor=new PhraseSplitExtractor(index,trainIdTranslator).setMinDataPerLeaf(config.getInt("String_Node_Str")).setMinDf(config.getInt("String_Node_Str")).setTopN(config.getInt("String_Node_Str"));
  DFStats dfStats=loadDFStats(config,index,trainIdTranslator);
  List<Set<String>> seedsForAllClasses=new ArrayList<>();
  for (int i=0; i < numClasses; i++) {
    Set<String> set=new HashSet<>();
    set.addAll(dfStats.getSortedTerms(i,50,100));
    seedsForAllClasses.add(set);
  }
  Set<String> blackList=new HashSet<>();
  for (  Set<String> seeds : seedsForAllClasses) {
    for (    String term : seeds) {
      int featureIndex=featureMappers.nextAvailable();
      SearchResponse response=index.match(index.getBodyField(),term,trainIdTranslator.getAllExtIds(),MatchQueryBuilder.Operator.AND);
      for (      SearchHit hit : response.getHits().getHits()) {
        String indexId=hit.getId();
        int algorithmId=trainIdTranslator.toIntId(indexId);
        float score=hit.getScore();
        dataSet.setFeatureValue(algorithmId,featureIndex,score);
      }
      NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(term).setSource("String_Node_Str").build();
      featureMappers.addMapper(mapper);
      blackList.add(term);
    }
  }
  for (int iteration=0; iteration < numIterations; iteration++) {
    System.out.println("String_Node_Str" + iteration);
    lkTreeBoost.calGradients();
    boolean condition1=(featureMappers.getTotalDim() + numNgramsToExtract * numClasses * 2 + config.getInt("String_Node_Str") * 2 < dataSet.getNumFeatures());
    boolean condition2=(Math.random() < extractionFrequency);
    boolean condition3=(iteration == 0);
    boolean shouldExtractFeatures=condition1 && condition2 || condition3;
    if (!shouldExtractFeatures) {
      if (!condition1) {
        System.out.println("String_Node_Str" + "String_Node_Str");
      }
      if (!condition2) {
        System.out.println("String_Node_Str");
      }
    }
    if (shouldExtractFeatures && config.getBoolean("String_Node_Str")) {
      FocusSet focusSet=new FocusSet(numClasses);
      for (int k=0; k < numClasses; k++) {
        double[] gradient=lkTreeBoost.getGradient(k);
        Comparator<Pair<Integer,Double>> comparator=Comparator.comparing(Pair::getSecond);
        List<Integer> easyExamples=IntStream.range(0,gradient.length).mapToObj(i -> new Pair<>(i,gradient[i])).filter(pair -> pair.getSecond() > 0).sorted(comparator).limit(numDocsToSelect).map(Pair::getFirst).collect(Collectors.toList());
        for (        Integer doc : easyExamples) {
          focusSet.add(doc,k);
        }
      }
      List<Integer> validationSet=focusSet.getAll();
      for (int k=0; k < numClasses; k++) {
        double[] allGradients=lkTreeBoost.getGradient(k);
        List<Double> gradientsForValidation=validationSet.stream().map(i -> allGradients[i]).collect(Collectors.toList());
        List<String> goodTerms=null;
        if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=splitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfExtractor.getGoodTerms(focusSet,blackList,k);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfSplitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
        seedsForAllClasses.get(k).addAll(goodTerms);
        List<String> focusSetIndexIds=focusSet.getDataClassK(k).parallelStream().map(trainIdTranslator::toExtId).collect(Collectors.toList());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(focusSetIndexIds.toString());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodTerms);
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(seedsForAllClasses.get(k));
        List<String> goodPhrases=phraseSplitExtractor.getGoodPhrases(focusSet,validationSet,blackList,k,gradientsForValidation,seedsForAllClasses.get(k));
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodPhrases);
        blackList.addAll(goodPhrases);
        for (        String ngram : goodTerms) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.match(index.getBodyField(),ngram,trainIdTranslator.getAllExtIds(),MatchQueryBuilder.Operator.AND);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(ngram).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
          blackList.add(ngram);
        }
        for (        String phrase : goodPhrases) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.matchPhrase(index.getBodyField(),phrase,trainIdTranslator.getAllExtIds(),0);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(phrase).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
        }
      }
    }
    if (shouldExtractFeatures && config.getBoolean("String_Node_Str")) {
      FocusSet focusSet=new FocusSet(numClasses);
      for (int k=0; k < numClasses; k++) {
        double[] gradient=lkTreeBoost.getGradient(k);
        Comparator<Pair<Integer,Double>> comparator=Comparator.comparing(Pair::getSecond);
        List<Integer> hardExamples=IntStream.range(0,gradient.length).mapToObj(i -> new Pair<>(i,gradient[i])).filter(pair -> pair.getSecond() > 0).sorted(comparator.reversed()).limit(numDocsToSelect).map(Pair::getFirst).collect(Collectors.toList());
        for (        Integer doc : hardExamples) {
          focusSet.add(doc,k);
        }
      }
      List<Integer> validationSet=focusSet.getAll();
      for (int k=0; k < numClasses; k++) {
        double[] allGradients=lkTreeBoost.getGradient(k);
        List<Double> gradientsForValidation=validationSet.stream().map(i -> allGradients[i]).collect(Collectors.toList());
        List<String> goodTerms=null;
        if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=splitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfExtractor.getGoodTerms(focusSet,blackList,k);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfSplitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
        seedsForAllClasses.get(k).addAll(goodTerms);
        List<String> focusSetIndexIds=focusSet.getDataClassK(k).parallelStream().map(trainIdTranslator::toExtId).collect(Collectors.toList());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(focusSetIndexIds.toString());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodTerms);
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(seedsForAllClasses.get(k));
        List<String> goodPhrases=phraseSplitExtractor.getGoodPhrases(focusSet,validationSet,blackList,k,gradientsForValidation,seedsForAllClasses.get(k));
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodPhrases);
        blackList.addAll(goodPhrases);
        for (        String ngram : goodTerms) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.match(index.getBodyField(),ngram,trainIdTranslator.getAllExtIds(),MatchQueryBuilder.Operator.AND);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(ngram).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
          blackList.add(ngram);
        }
        for (        String phrase : goodPhrases) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.matchPhrase(index.getBodyField(),phrase,trainIdTranslator.getAllExtIds(),0);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(phrase).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
        }
      }
    }
    int[] activeFeatures=IntStream.range(0,featureMappers.getTotalDim()).toArray();
    lkTreeBoost.setActiveFeatures(activeFeatures);
    lkTreeBoost.fitRegressors();
  }
  File serializedModel=new File(archive,modelName);
  if (!overwriteModels && serializedModel.exists()) {
    throw new RuntimeException(serializedModel.getAbsolutePath() + "String_Node_Str");
  }
  lkTreeBoost.serialize(serializedModel);
  System.out.println("String_Node_Str" + serializedModel.getAbsolutePath());
  System.out.println("String_Node_Str" + Accuracy.accuracy(lkTreeBoost,dataSet));
  System.out.println("String_Node_Str" + stopWatch);
}

Fixed version (ground truth):
static void trainModel(Config config,ClfDataSet dataSet,FeatureMappers featureMappers,ESIndex index,IdTranslator trainIdTranslator) throws Exception {
  String archive=config.getString("String_Node_Str");
  int numIterations=config.getInt("String_Node_Str");
  int numClasses=config.getInt("String_Node_Str");
  int numLeaves=config.getInt("String_Node_Str");
  double learningRate=config.getDouble("String_Node_Str");
  int trainMinDataPerLeaf=config.getInt("String_Node_Str");
  String modelName=config.getString("String_Node_Str");
  boolean overwriteModels=config.getBoolean("String_Node_Str");
  int numDocsToSelect=config.getInt("String_Node_Str");
  int numNgramsToExtract=config.getInt("String_Node_Str");
  double extractionFrequency=config.getDouble("String_Node_Str");
  if (extractionFrequency > 1 || extractionFrequency < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Map<Integer,String> labelMap=dataSet.getSetting().getLabelMap();
  StopWatch stopWatch=new StopWatch();
  stopWatch.start();
  System.out.println("String_Node_Str");
  LKTBConfig trainConfig=new LKTBConfig.Builder(dataSet).learningRate(learningRate).minDataPerLeaf(trainMinDataPerLeaf).numLeaves(numLeaves).build();
  LKTreeBoost lkTreeBoost=new LKTreeBoost(numClasses);
  lkTreeBoost.setPriorProbs(dataSet);
  lkTreeBoost.setTrainConfig(trainConfig);
  TermSplitExtractor splitExtractor=new TermSplitExtractor(index,trainIdTranslator,numNgramsToExtract).setMinDataPerLeaf(config.getInt("String_Node_Str"));
  TermTfidfExtractor tfidfExtractor=new TermTfidfExtractor(index,trainIdTranslator,numNgramsToExtract).setMinDf(config.getInt("String_Node_Str"));
  TermTfidfSplitExtractor tfidfSplitExtractor=new TermTfidfSplitExtractor(index,trainIdTranslator,numNgramsToExtract).setMinDf(config.getInt("String_Node_Str")).setNumSurvivors(config.getInt("String_Node_Str")).setMinDataPerLeaf(config.getInt("String_Node_Str"));
  PhraseSplitExtractor phraseSplitExtractor=new PhraseSplitExtractor(index,trainIdTranslator).setMinDataPerLeaf(config.getInt("String_Node_Str")).setMinDf(config.getInt("String_Node_Str")).setTopN(config.getInt("String_Node_Str"));
  DFStats dfStats=loadDFStats(config,index,trainIdTranslator);
  List<Set<String>> seedsForAllClasses=new ArrayList<>();
  for (int i=0; i < numClasses; i++) {
    Set<String> set=new HashSet<>();
    set.addAll(dfStats.getSortedTerms(i,50,100));
    seedsForAllClasses.add(set);
  }
  Set<String> blackList=new HashSet<>();
  for (  Set<String> seeds : seedsForAllClasses) {
    for (    String term : seeds) {
      int featureIndex=featureMappers.nextAvailable();
      SearchResponse response=index.match(index.getBodyField(),term,trainIdTranslator.getAllExtIds(),MatchQueryBuilder.Operator.AND);
      for (      SearchHit hit : response.getHits().getHits()) {
        String indexId=hit.getId();
        int algorithmId=trainIdTranslator.toIntId(indexId);
        float score=hit.getScore();
        dataSet.setFeatureValue(algorithmId,featureIndex,score);
      }
      NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(term).setSource("String_Node_Str").build();
      featureMappers.addMapper(mapper);
      blackList.add(term);
    }
  }
  for (int iteration=0; iteration < numIterations; iteration++) {
    System.out.println("String_Node_Str" + iteration);
    lkTreeBoost.calGradients();
    boolean condition1=(featureMappers.getTotalDim() + numNgramsToExtract * numClasses * 2 + config.getInt("String_Node_Str") * numClasses * 2 < dataSet.getNumFeatures());
    boolean condition2=(Math.random() < extractionFrequency);
    boolean condition3=(iteration == 0);
    boolean shouldExtractFeatures=condition1 && condition2 || condition3;
    if (!shouldExtractFeatures) {
      if (!condition1) {
        System.out.println("String_Node_Str" + "String_Node_Str");
      }
      if (!condition2) {
        System.out.println("String_Node_Str");
      }
    }
    if (shouldExtractFeatures && config.getBoolean("String_Node_Str")) {
      FocusSet focusSet=new FocusSet(numClasses);
      for (int k=0; k < numClasses; k++) {
        double[] gradient=lkTreeBoost.getGradient(k);
        Comparator<Pair<Integer,Double>> comparator=Comparator.comparing(Pair::getSecond);
        List<Integer> easyExamples=IntStream.range(0,gradient.length).mapToObj(i -> new Pair<>(i,gradient[i])).filter(pair -> pair.getSecond() > 0).sorted(comparator).limit(numDocsToSelect).map(Pair::getFirst).collect(Collectors.toList());
        for (        Integer doc : easyExamples) {
          focusSet.add(doc,k);
        }
      }
      List<Integer> validationSet=focusSet.getAll();
      for (int k=0; k < numClasses; k++) {
        double[] allGradients=lkTreeBoost.getGradient(k);
        List<Double> gradientsForValidation=validationSet.stream().map(i -> allGradients[i]).collect(Collectors.toList());
        List<String> goodTerms=null;
        if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=splitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfExtractor.getGoodTerms(focusSet,blackList,k);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfSplitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
        seedsForAllClasses.get(k).addAll(goodTerms);
        List<String> focusSetIndexIds=focusSet.getDataClassK(k).parallelStream().map(trainIdTranslator::toExtId).collect(Collectors.toList());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(focusSetIndexIds.toString());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodTerms);
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(seedsForAllClasses.get(k));
        List<String> goodPhrases=phraseSplitExtractor.getGoodPhrases(focusSet,validationSet,blackList,k,gradientsForValidation,seedsForAllClasses.get(k));
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodPhrases);
        blackList.addAll(goodPhrases);
        for (        String ngram : goodTerms) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.match(index.getBodyField(),ngram,trainIdTranslator.getAllExtIds(),MatchQueryBuilder.Operator.AND);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(ngram).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
          blackList.add(ngram);
        }
        for (        String phrase : goodPhrases) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.matchPhrase(index.getBodyField(),phrase,trainIdTranslator.getAllExtIds(),0);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(phrase).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
        }
      }
    }
    if (shouldExtractFeatures && config.getBoolean("String_Node_Str")) {
      FocusSet focusSet=new FocusSet(numClasses);
      for (int k=0; k < numClasses; k++) {
        double[] gradient=lkTreeBoost.getGradient(k);
        Comparator<Pair<Integer,Double>> comparator=Comparator.comparing(Pair::getSecond);
        List<Integer> hardExamples=IntStream.range(0,gradient.length).mapToObj(i -> new Pair<>(i,gradient[i])).filter(pair -> pair.getSecond() > 0).sorted(comparator.reversed()).limit(numDocsToSelect).map(Pair::getFirst).collect(Collectors.toList());
        for (        Integer doc : hardExamples) {
          focusSet.add(doc,k);
        }
      }
      List<Integer> validationSet=focusSet.getAll();
      for (int k=0; k < numClasses; k++) {
        double[] allGradients=lkTreeBoost.getGradient(k);
        List<Double> gradientsForValidation=validationSet.stream().map(i -> allGradients[i]).collect(Collectors.toList());
        List<String> goodTerms=null;
        if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=splitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfExtractor.getGoodTerms(focusSet,blackList,k);
        }
 else         if (config.getString("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
          goodTerms=tfidfSplitExtractor.getGoodTerms(focusSet,validationSet,blackList,k,gradientsForValidation);
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
        seedsForAllClasses.get(k).addAll(goodTerms);
        List<String> focusSetIndexIds=focusSet.getDataClassK(k).parallelStream().map(trainIdTranslator::toExtId).collect(Collectors.toList());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(focusSetIndexIds.toString());
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodTerms);
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(seedsForAllClasses.get(k));
        List<String> goodPhrases=phraseSplitExtractor.getGoodPhrases(focusSet,validationSet,blackList,k,gradientsForValidation,seedsForAllClasses.get(k));
        System.out.println("String_Node_Str" + k + "String_Node_Str"+ labelMap.get(k)+ "String_Node_Str");
        System.out.println(goodPhrases);
        blackList.addAll(goodPhrases);
        for (        String ngram : goodTerms) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.match(index.getBodyField(),ngram,trainIdTranslator.getAllExtIds(),MatchQueryBuilder.Operator.AND);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(ngram).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
          blackList.add(ngram);
        }
        for (        String phrase : goodPhrases) {
          int featureIndex=featureMappers.nextAvailable();
          SearchResponse response=index.matchPhrase(index.getBodyField(),phrase,trainIdTranslator.getAllExtIds(),0);
          for (          SearchHit hit : response.getHits().getHits()) {
            String indexId=hit.getId();
            int algorithmId=trainIdTranslator.toIntId(indexId);
            float score=hit.getScore();
            dataSet.setFeatureValue(algorithmId,featureIndex,score);
          }
          NumericalFeatureMapper mapper=NumericalFeatureMapper.getBuilder().setFeatureIndex(featureIndex).setFeatureName(phrase).setSource("String_Node_Str").build();
          featureMappers.addMapper(mapper);
        }
      }
    }
    int[] activeFeatures=IntStream.range(0,featureMappers.getTotalDim()).toArray();
    lkTreeBoost.setActiveFeatures(activeFeatures);
    lkTreeBoost.fitRegressors();
  }
  File serializedModel=new File(archive,modelName);
  if (!overwriteModels && serializedModel.exists()) {
    throw new RuntimeException(serializedModel.getAbsolutePath() + "String_Node_Str");
  }
  lkTreeBoost.serialize(serializedModel);
  System.out.println("String_Node_Str" + serializedModel.getAbsolutePath());
  System.out.println("String_Node_Str" + Accuracy.accuracy(lkTreeBoost,dataSet));
  System.out.println("String_Node_Str" + stopWatch);
}