public void testWeighted(String prefix, int maxIter, int seedSize,
            double threshold, int noTrees) throws FileNotFoundException {
        if (noTrees == 0) {
            noTrees = Integer.MAX_VALUE;
        }
        double sumacc = 0.0;
//        double sumaccw = 0.0;
        double acc = 0.0;
//        double accw = 0.0;
        double prediction = 0.0;
        int realnoTrees = 0;
        for (int i = 0; i < noFold; i++) {
            System.out.println("################ Fold no " + i);
            Set<Integer> trainingSet = new HashSet<Integer>(sampleIndex);
            trainingSet.removeAll(foldList.get(i));

            // create the forest
            DecisionTreeController controller = new DecisionTreeController(trainingSet, ppiGraph, storeFile);
            MetroSampler sampler = new WeightedSamplerMH_Fast(controller);
            sampler.sample(maxIter, seedSize, threshold);

            OptimalForest forest = sampler.createForest(threshold, noTrees);
            realnoTrees += forest.forest.size();
            // test using the forest created
            Set<Integer> testSet = foldList.get(i);
//            String outputFile = prefix + Integer.toString(i);
//            PrintStream out = new PrintStream(new FileOutputStream(outputFile));

//            String outputFileWeighted = prefix + "weighted_" + Integer.toString(i);
//            PrintStream outWeighted = new PrintStream(new FileOutputStream(outputFileWeighted));

            acc = 0.0;
//            accw = 0.0;
            for (Integer s : testSet) {
                ArrayList<String> sample = sampleInfoStore.get(s);
                List<String> features = sample.subList(1, sample.size());
                Integer classLabel = 0;
                if (storeFile[s][0]) {
                    classLabel = 1;
                }
//                double prediction = forest.weightedClassify(features);
                prediction = forest.classify(features);
//                out.println(classLabel + " " + prediction);
                if (classLabel == 1 && prediction >= 0.5
                        || classLabel == 0 && prediction < 0.5) {
                    acc += 1;
                }

//                prediction = forest.weightedClassify(features);
//                outWeighted.println(classLabel + " " + prediction);
//                if (classLabel == 1 && prediction >= 0.5 ||
//                        classLabel == 0 && prediction < 0.5){
//                    accw += 1;
//                }
            }
            acc /= testSet.size();
            sumacc += acc;
//            accw /= testSet.size();
//            sumaccw += accw;

//            out.close();
//            outWeighted.close();
        }
        sumacc /= noFold;
//        sumaccw /= noFold;
        System.err.println("No Tree: " + (double) realnoTrees / noFold + " Accuracy: " + sumacc);
//        System.err.println("No Tree: " + (double)realnoTrees/noFold + " AccuracyW: " + sumaccw);
    }