@Override
	public void buildModel(Dataset dataset) 
	{
		estimators = new DecisionTreeC45[estimatorCount];
		estimatorWeight = new double[estimatorCount];
		for(int i = 0; i < estimatorCount; i++)
		{
			estimators[i] = new DecisionTreeC45();
			estimators[i].maxHeight = splitCount;
			estimators[i].needPrune = false;
			estimators[i].buildModel(dataset);
			double error = 0, sum = 0;
			for(int j = 0; j < dataset.data.size(); j++)
			{
				if(dataset.data.get(j).type != InstanceType.Train)
					continue;
				estimators[i].predict(dataset.data.get(j));
				if(dataset.data.get(j).predict != dataset.data.get(j).target)
					error += dataset.data.get(j).weight;
				sum += dataset.data.get(j).weight;
			}
			double errorRate = error / sum;
			estimatorWeight[i] = Math.log((1-errorRate)/errorRate);
			for(int j = 0; j < dataset.data.size(); j++)
			{
				if(dataset.data.get(j).type != InstanceType.Train)
					continue;
				if(dataset.data.get(j).predict != dataset.data.get(j).target)
					dataset.data.get(j).weight *= Math.exp(estimatorWeight[i]/2);
				else
					dataset.data.get(j).weight /= Math.exp(estimatorWeight[i]/2);
			}
			System.out.println(estimatorWeight[i]);
		}
	}