public void buildAdaBoostTree(ArrayList<Sample> trainSamples) {
		for (int i = 0; i < trainSamples.size(); i++) {
			trainSamples.get(i).setWeight(1.0/trainSamples.size());
		}
		for (int j = 0; j < 10; j++) {
			// on each iteration, train on 2500 samples
			ArrayList<Sample> allCopy = new ArrayList<Sample>(trainSamples);
			ArrayList<Sample> train = new ArrayList<Sample>();
			for (int k = 0; k < 2500; k++) {
				int randIndex = sampleFromDistr(allCopy);
				train.add(allCopy.get(randIndex));
				allCopy.remove(randIndex);
			}
			DecisionTree decTree = new DecisionTree(train, Classifier.DT_OPTIMAL_LEAF_SIZE, Classifier.DT_OPTIMAL_TRAIN_ENTR, Classifier.DT_OPTIMAL_DEPTH, 1);
			weakTrees.add(decTree);
			decTree.classifyAll(trainSamples);
			
			Double errorRate = getErrorRate(trainSamples);
			
			alphas.add(.5*Math.log((1-errorRate)/errorRate));

			for (int i = 0; i < rightClass.size(); i++) {
				Sample curr = rightClass.get(i);
				curr.setWeight(Math.exp(-1.0*alphas.get(j)*curr.getWeight()));
			}
			for (int i = 0; i < wrongClass.size(); i++) {
				Sample curr = wrongClass.get(i);
				curr.setWeight(Math.exp(alphas.get(j)*curr.getWeight()));
			}

			double tempTotalWeight = 0.0;
			for (int i = 0; i < trainSamples.size(); i++) {
				tempTotalWeight += trainSamples.get(i).getWeight();
			}
			for (int i = 0; i < trainSamples.size(); i++) {
				trainSamples.get(i).setWeight(trainSamples.get(i).getWeight()/tempTotalWeight);
			}
			
		}
	}