public double getInformationFor()
{
String attributeName = specification.getTarget();
Dictionary <String, int> counts = new Dictionary <String, int>();
foreach (Example e in examples)
{
String val = e.getAttributeValueAsString(attributeName);
if (counts.ContainsKey(val))
{
counts[val]++;
}
else
{
counts.Add(val, 1);
}
}
double[] data = new double[counts.Keys.Count];
int i = 0;
foreach (string key in counts.Keys)
{
data[i] = counts[key];
i++;
}
data = Util.normalize(data);
return(Util.information(data));
}