Program: 50995
Project: 50995
Buggy source:
public static void main(String[] args){
  long seed=1;
  createTask1DataSet(1,seed);
  double[] bins={0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,12.5,15.5,18.5,23.5};
  long[] seeds={11,21,31,41,51,61,71,81,91,101};
  double[] cs={1,10,100,1000,10000};
  int[] depths={1,2,3};
  int[] iterations={0};
  double[] ps1={1};
  double[] ps2={0.000001,0.00001,0.0001,0.001,0.01};
  List<Double> target=new ArrayList<Double>();
  List<Double> targetBins=new ArrayList<Double>();
  for (  Value label : labels) {
    double val=LiteralUtil.getDoubleValue(label,0);
    target.add(val);
    for (int i=0; i < bins.length - 1; i++) {
      if (val > bins[i] && val <= bins[i + 1]) {
        targetBins.add(i + 1.0);
      }
    }
  }
  ResultsTable resTable=new ResultsTable();
  resTable.setManWU(0.05);
  boolean inference=true;
  List<EvaluationFunction> evalFuncs1=new ArrayList<EvaluationFunction>();
  evalFuncs1.add(new Task1ScoreForBins(bins));
  List<EvaluationFunction> evalFuncs2=new ArrayList<EvaluationFunction>();
  evalFuncs2.add(new Task1Score());
  evalFuncs2.add(new MeanSquaredError());
  evalFuncs2.add(new MeanAbsoluteError());
  for (  int d : depths) {
    for (    int it : iterations) {
      resTable.newRow("String_Node_Str");
      LibLINEARParameters linParms=new LibLINEARParameters(LibLINEARParameters.SVC_DUAL,cs);
      linParms.setEvalFunction(new Task1ScoreForBothBins(bins));
      linParms.setDoCrossValidation(false);
      linParms.setSplitFraction((float)0.8);
      linParms.setEps(0.00001);
      linParms.setPs(ps1);
      Map<Double,Double> counts=EvaluationUtils.computeClassCounts(targetBins);
      int[] wLabels=new int[counts.size()];
      double[] weights=new double[counts.size()];
      for (      double label : counts.keySet()) {
        wLabels[(int)label - 1]=(int)label;
        weights[(int)label - 1]=1 / counts.get(label);
      }
      linParms.setWeightLabels(wLabels);
      linParms.setWeights(weights);
      LibLINEARParameters linParms2=new LibLINEARParameters(LibLINEARParameters.SVR_DUAL,cs);
      linParms2.setEvalFunction(new Task1Score());
      linParms2.setDoCrossValidation(false);
      linParms2.setSplitFraction((float)0.8);
      linParms2.setEps(0.00001);
      linParms2.setPs(ps2);
      linParms2.setBias(1);
      List<RDFFeatureVectorKernel> kernels=new ArrayList<RDFFeatureVectorKernel>();
      kernels.add(new RDFIntersectionTreeEdgeVertexPathWithTextKernel(d,inference,true));
      RDFFeatureVectorKernel kernel=new RDFCombinedKernel(kernels,true);
      System.out.println("String_Node_Str" + d + "String_Node_Str"+ it);
      Map<EvaluationFunction,double[]> resultMap=new HashMap<EvaluationFunction,double[]>();
      Map<EvaluationFunction,double[]> resultMap2=new HashMap<EvaluationFunction,double[]>();
      List<Result> results=new ArrayList<Result>();
      for (      EvaluationFunction evalFunc : evalFuncs1) {
        Result res=new Result();
        double[] resA=new double[seeds.length];
        res.setLabel(evalFunc.getLabel());
        res.setScores(resA);
        res.setHigherIsBetter(evalFunc.isHigherIsBetter());
        results.add(res);
        resultMap.put(evalFunc,resA);
      }
      for (      EvaluationFunction evalFunc : evalFuncs2) {
        Result res=new Result();
        double[] resA=new double[seeds.length];
        res.setLabel(evalFunc.getLabel());
        res.setScores(resA);
        res.setHigherIsBetter(evalFunc.isHigherIsBetter());
        results.add(res);
        resultMap2.put(evalFunc,resA);
      }
      Result compR=new Result();
      results.add(compR);
      long tic, toc;
      List<Double> tempLabels=new ArrayList<Double>();
      List<Double> tempLabelsBins=new ArrayList<Double>();
      tempLabels.addAll(target);
      tempLabelsBins.addAll(targetBins);
      tic=System.currentTimeMillis();
      SparseVector[] fv=kernel.computeFeatureVectors(dataset,instances,blackList);
      toc=System.currentTimeMillis();
      List<SparseVector> fvList=Arrays.asList(fv);
      compR.setLabel("String_Node_Str");
      for (int j=0; j < seeds.length; j++) {
        Collections.shuffle(fvList,new Random(seeds[j]));
        Collections.shuffle(tempLabels,new Random(seeds[j]));
        Collections.shuffle(tempLabelsBins,new Random(seeds[j]));
        fv=fvList.toArray(new SparseVector[1]);
        double[] targetA=new double[tempLabels.size()];
        double[] targetABins=new double[tempLabelsBins.size()];
        for (int i=0; i < targetA.length; i++) {
          targetA[i]=tempLabels.get(i);
          targetABins[i]=tempLabelsBins.get(i);
        }
        Prediction[] pred=LibLINEAR.trainTestSplit(fv,targetABins,linParms,linParms.getSplitFraction());
        Prediction[] pred2=LibLINEAR.trainTestSplit(fv,targetA,linParms2,linParms2.getSplitFraction());
        double[] targetSplit=LibLINEAR.splitTestTarget(targetA,linParms.getSplitFraction());
        for (        EvaluationFunction ef : evalFuncs1) {
          resultMap.get(ef)[j]=ef.computeScore(targetSplit,pred);
        }
        for (        EvaluationFunction ef : evalFuncs2) {
          resultMap2.get(ef)[j]=ef.computeScore(targetSplit,pred2);
        }
      }
      double[] comp={toc - tic};
      compR.setScores(comp);
      for (      Result res : results) {
        resTable.addResult(res);
      }
    }
  }
  saveResults(resTable,"String_Node_Str" + seed + "String_Node_Str");
  resTable.addCompResults(resTable.getBestResults());
  System.out.println(resTable);
  saveResults(resTable.toString(),"String_Node_Str" + seed + "String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  long seed=1;
  createTask1DataSet(1,seed);
  double[] bins={0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,12.5,15.5,18.5,23.5};
  long[] seeds={11,21,31,41,51,61,71,81,91,101};
  double[] cs={0.0001,0.001,0.01,0.1,1,10,100,1000,10000};
  int[] depths={1,2,3};
  int[] iterations={0};
  double[] ps1={1};
  double[] ps2={0.000001,0.00001,0.0001,0.001,0.01};
  List<Double> target=new ArrayList<Double>();
  List<Double> targetBins=new ArrayList<Double>();
  for (  Value label : labels) {
    double val=LiteralUtil.getDoubleValue(label,0);
    target.add(val);
    for (int i=0; i < bins.length - 1; i++) {
      if (val > bins[i] && val <= bins[i + 1]) {
        targetBins.add(i + 1.0);
      }
    }
  }
  ResultsTable resTable=new ResultsTable();
  resTable.setManWU(0.05);
  boolean inference=true;
  List<EvaluationFunction> evalFuncs1=new ArrayList<EvaluationFunction>();
  evalFuncs1.add(new Task1ScoreForBins(bins));
  List<EvaluationFunction> evalFuncs2=new ArrayList<EvaluationFunction>();
  evalFuncs2.add(new Task1Score());
  evalFuncs2.add(new MeanSquaredError());
  evalFuncs2.add(new MeanAbsoluteError());
  for (  int d : depths) {
    for (    int it : iterations) {
      resTable.newRow("String_Node_Str");
      LibLINEARParameters linParms=new LibLINEARParameters(LibLINEARParameters.SVC_DUAL,cs);
      linParms.setEvalFunction(new Task1ScoreForBothBins(bins));
      linParms.setDoCrossValidation(false);
      linParms.setSplitFraction((float)0.8);
      linParms.setEps(0.00001);
      linParms.setPs(ps1);
      Map<Double,Double> counts=EvaluationUtils.computeClassCounts(targetBins);
      int[] wLabels=new int[counts.size()];
      double[] weights=new double[counts.size()];
      for (      double label : counts.keySet()) {
        wLabels[(int)label - 1]=(int)label;
        weights[(int)label - 1]=1 / counts.get(label);
      }
      linParms.setWeightLabels(wLabels);
      linParms.setWeights(weights);
      LibLINEARParameters linParms2=new LibLINEARParameters(LibLINEARParameters.SVR_DUAL,cs);
      linParms2.setEvalFunction(new Task1Score());
      linParms2.setDoCrossValidation(false);
      linParms2.setSplitFraction((float)0.8);
      linParms2.setEps(0.00001);
      linParms2.setPs(ps2);
      linParms2.setBias(1);
      List<RDFFeatureVectorKernel> kernels=new ArrayList<RDFFeatureVectorKernel>();
      kernels.add(new RDFIntersectionTreeEdgeVertexPathWithTextKernel(d,inference,true));
      RDFFeatureVectorKernel kernel=new RDFCombinedKernel(kernels,true);
      System.out.println("String_Node_Str" + d + "String_Node_Str"+ it);
      Map<EvaluationFunction,double[]> resultMap=new HashMap<EvaluationFunction,double[]>();
      Map<EvaluationFunction,double[]> resultMap2=new HashMap<EvaluationFunction,double[]>();
      List<Result> results=new ArrayList<Result>();
      for (      EvaluationFunction evalFunc : evalFuncs1) {
        Result res=new Result();
        double[] resA=new double[seeds.length];
        res.setLabel(evalFunc.getLabel());
        res.setScores(resA);
        res.setHigherIsBetter(evalFunc.isHigherIsBetter());
        results.add(res);
        resultMap.put(evalFunc,resA);
      }
      for (      EvaluationFunction evalFunc : evalFuncs2) {
        Result res=new Result();
        double[] resA=new double[seeds.length];
        res.setLabel(evalFunc.getLabel());
        res.setScores(resA);
        res.setHigherIsBetter(evalFunc.isHigherIsBetter());
        results.add(res);
        resultMap2.put(evalFunc,resA);
      }
      Result compR=new Result();
      results.add(compR);
      long tic, toc;
      List<Double> tempLabels=new ArrayList<Double>();
      List<Double> tempLabelsBins=new ArrayList<Double>();
      tempLabels.addAll(target);
      tempLabelsBins.addAll(targetBins);
      tic=System.currentTimeMillis();
      SparseVector[] fv=kernel.computeFeatureVectors(dataset,instances,blackList);
      toc=System.currentTimeMillis();
      List<SparseVector> fvList=Arrays.asList(fv);
      compR.setLabel("String_Node_Str");
      for (int j=0; j < seeds.length; j++) {
        Collections.shuffle(fvList,new Random(seeds[j]));
        Collections.shuffle(tempLabels,new Random(seeds[j]));
        Collections.shuffle(tempLabelsBins,new Random(seeds[j]));
        fv=fvList.toArray(new SparseVector[1]);
        double[] targetA=new double[tempLabels.size()];
        double[] targetABins=new double[tempLabelsBins.size()];
        for (int i=0; i < targetA.length; i++) {
          targetA[i]=tempLabels.get(i);
          targetABins[i]=tempLabelsBins.get(i);
        }
        Prediction[] pred=LibLINEAR.trainTestSplit(fv,targetABins,linParms,linParms.getSplitFraction());
        Prediction[] pred2=LibLINEAR.trainTestSplit(fv,targetA,linParms2,linParms2.getSplitFraction());
        double[] targetSplit=LibLINEAR.splitTestTarget(targetA,linParms.getSplitFraction());
        for (        EvaluationFunction ef : evalFuncs1) {
          resultMap.get(ef)[j]=ef.computeScore(targetSplit,pred);
        }
        for (        EvaluationFunction ef : evalFuncs2) {
          resultMap2.get(ef)[j]=ef.computeScore(targetSplit,pred2);
        }
      }
      double[] comp={toc - tic};
      compR.setScores(comp);
      for (      Result res : results) {
        resTable.addResult(res);
      }
    }
  }
  saveResults(resTable,"String_Node_Str" + seed + "String_Node_Str");
  resTable.addCompResults(resTable.getBestResults());
  System.out.println(resTable);
  saveResults(resTable.toString(),"String_Node_Str" + seed + "String_Node_Str");
}