@Override protected InformationLossWithBound<InformationLossDefault> getInformationLossInternal( final Node node, final HashGroupify g) { if (node.getLowerBound() != null) { return new InformationLossWithBound<InformationLossDefault>( (InformationLossDefault) node.getLowerBound(), (InformationLossDefault) node.getLowerBound()); } // Init double result = 0; // For each column for (int column = 0; column < hierarchies.length; column++) { // Check for cached value final int state = node.getTransformation()[column]; double value = cache[column][state]; if (value == NA) { value = 0d; final int[][] cardinality = cardinalities[column]; final int[][] hierarchy = hierarchies[column]; for (int in = 0; in < hierarchy.length; in++) { final int out = hierarchy[in][state]; final double a = cardinality[in][0]; final double b = cardinality[out][state]; if (a != 0d) { value += a * log2(a / b); } } cache[column][state] = value; } result += value; } result = round(result == 0.0d ? result : -result); return new InformationLossDefaultWithBound(result, result); }