public int calculateSelectedAttribute(TreeNode node) {
		int selectedAttribute = -1;
		double minRelativeEntropy = 999999;
		for(int i : node.unProcessedAttributes) {
			int total = node.Y.size();
			int count[][] = new int[attributePossibleValues[i]][classValues];
			for(int j = 0; j < total; j++) {
				count[node.X.get(j).attributes[i]][node.Y.get(j)]++;
			}

			double relativeEntropy = 0;
			for(int k = 0; k < attributePossibleValues[i]; k++) {
				double localEntropy = 0;
				int subTotal = 0;
				for(int l = 0; l < classValues; l++) {
					subTotal += count[k][l];
				}
				for(int l = 0; l < classValues; l++) {
					if(subTotal != 0 && count[k][l] != 0) {
						double probability = (double) count[k][l]/subTotal;
						localEntropy += -probability*(Math.log(probability)/Math.log(2));
					}
				}
				relativeEntropy += ((double)subTotal/total)*localEntropy;
				
			}
			if(minRelativeEntropy > relativeEntropy) {
				minRelativeEntropy = relativeEntropy;
				selectedAttribute = i;
			}
		}
		return selectedAttribute;
	}