public double calculateGainFor(String parameterName)
{
Dictionary<String, DataSet> hash = splitByAttribute(parameterName);
double totalSize = examples.Count;
double remainder = 0.0;
foreach (String parameterValue in hash.Keys)
{
double reducedDataSetSize = hash[parameterValue].examples
.Count;
remainder += (reducedDataSetSize / totalSize)
* hash[parameterValue].getInformationFor();
}
return getInformationFor() - remainder;
}