Skip to content

Commit 984f38f

Browse files
committed
Try to address issue #457
1 parent c8c26c9 commit 984f38f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/org/deidentifier/arx/metric/v2/MetricSDNMEntropyBasedInformationLoss.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ public static double getEntropyBasedInformationLoss(Transformation<?> transforma
8383
// IL = log(share_1 * share_2 * ... * share_n) / maxIL + 1
8484
//
8585
// For attributes transformed with microaggregation, we set share_i to 1/#distinct-values-in-eq-class and size_i to the #distinct-values-in-dataset
86-
86+
87+
// If there is no information, no information can be lost
88+
if (maxIL == 0 || Double.isNaN(maxIL) || Double.isInfinite(maxIL)) {
89+
return 0d;
90+
}
91+
8792
int[] generalization = transformation.getGeneralization();
8893
double infoLoss = 1d;
8994
entry.read();

0 commit comments

Comments
 (0)