/// <summary> Computes entropy of distribution after splitting.</summary>
		public double newEnt(Distribution bags)
		{
			
			double returnValue = 0;
			int i, j;
			
			for (i = 0; i < bags.numBags(); i++)
			{
				for (j = 0; j < bags.numClasses(); j++)
					returnValue = returnValue + logFunc(bags.perClassPerBag(i, j));
				returnValue = returnValue - logFunc(bags.perBag(i));
			}
			return - returnValue;
		}
		/// <summary> Computes entropy of test distribution with respect to training distribution.</summary>
		public override double splitCritValue(Distribution train, Distribution test)
		{
			
			double result = 0;
			int numClasses = 0;
			int i, j;
			
			// Find out relevant number of classes
			for (j = 0; j < test.numClasses(); j++)
				if (Utils.gr(train.perClass(j), 0) || Utils.gr(test.perClass(j), 0))
					numClasses++;
			
			// Compute entropy of test data with respect to training data
			for (i = 0; i < test.numBags(); i++)
				if (Utils.gr(test.perBag(i), 0))
				{
					for (j = 0; j < test.numClasses(); j++)
						if (Utils.gr(test.perClassPerBag(i, j), 0))
							result -= test.perClassPerBag(i, j) * System.Math.Log(train.perClassPerBag(i, j) + 1);
					result += test.perBag(i) * System.Math.Log(train.perBag(i) + numClasses);
				}
			
			return result / log2;
		}