# Metric (ARX Developer Documentation)

org.deidentifier.arx.metric

## Class Metric<T extends InformationLoss<?>>

- java.lang.Object
- - org.deidentifier.arx.metric.Metric<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    AbstractMetricMultiDimensional, AbstractMetricSingleDimensional, MetricDefault, MetricWeighted

      public abstract class Metric<T extends InformationLoss<?>>
      extends java.lang.Object
      implements java.io.Serializable

  Abstract base class for metrics.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Metric.AggregateFunction` Pluggable aggregate functions.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Metric(boolean monotonicWithGeneralization, boolean monotonicWithSuppression, boolean independent, double gsFactor)` Create a new metric.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Metric<ILSingleDimensional>` | `createAECSMetric()` Creates a new instance of the AECS metric.
    `static Metric<ILSingleDimensional>` | `createAECSMetric(double gsFactor)` Creates a new instance of the AECS metric.
    `static Metric<ILSingleDimensional>` | `createAmbiguityMetric()` Creates an instance of the ambiguity metric.
    `static Metric<ILSingleDimensional>` | `createDiscernabilityMetric()` Creates an instance of the discernability metric.
    `static Metric<ILSingleDimensional>` | `createDiscernabilityMetric(boolean monotonic)` Creates an instance of the discernability metric.
    `static MetricSDNMEntropyBasedInformationLoss` | `createEntropyBasedInformationLossMetric()` Creates an instance of the entropy-based information loss metric, which will treat generalization and suppression equally.
    `static MetricSDNMEntropyBasedInformationLoss` | `createEntropyBasedInformationLossMetric(double gsFactor)` Creates an instance of the entropy-based information loss metric.
    `static Metric<AbstractILMultiDimensional>` | `createEntropyMetric()` Creates an instance of the non-monotonic non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createEntropyMetric(boolean monotonic)` Creates an instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createEntropyMetric(boolean monotonic, double gsFactor)` Creates an instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createEntropyMetric(boolean monotonic, double gsFactor, Metric.AggregateFunction function)` Creates an instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createEntropyMetric(boolean monotonic, Metric.AggregateFunction function)` Creates an instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createEntropyMetric(double gsFactor)` Creates an instance of the non-monotonic non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createHeightMetric()` Creates an instance of the height metric.
    `static Metric<AbstractILMultiDimensional>` | `createHeightMetric(Metric.AggregateFunction function)` Creates an instance of the height metric.
    `InformationLoss<?>` | `createInstanceOfHighestScore()` Returns an instance of the highest possible score.
    `InformationLoss<?>` | `createInstanceOfLowestScore()` Returns an instance of the lowest possible score.
    `static Metric<ILSingleDimensional>` | `createKLDivergenceMetric()` Creates an instance of the KL Divergence metric.
    `static Metric<AbstractILMultiDimensional>` | `createLossMetric()` Creates an instance of the loss metric which treats generalization and suppression equally.
    `static Metric<AbstractILMultiDimensional>` | `createLossMetric(double gsFactor)` Creates an instance of the loss metric with factors for weighting generalization and suppression.
    `static Metric<AbstractILMultiDimensional>` | `createLossMetric(double gsFactor, Metric.AggregateFunction function)` Creates an instance of the loss metric with factors for weighting generalization and suppression.
    `static Metric<AbstractILMultiDimensional>` | `createLossMetric(Metric.AggregateFunction function)` Creates an instance of the loss metric which treats generalization and suppression equally.
    `abstract InformationLoss<?>` | `createMaxInformationLoss()` Deprecated.
    `static Metric<?>` | `createMetric(Metric<?> metric, int minLevel, int maxLevel)` This method supports backwards compatibility.
    `abstract InformationLoss<?>` | `createMinInformationLoss()` Deprecated.
    `static Metric<AbstractILMultiDimensional>` | `createNormalizedEntropyMetric()` Creates an instance of the normalized entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createNormalizedEntropyMetric(Metric.AggregateFunction function)` Creates an instance of the normalized entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric()` Creates an instance of the non-monotonic precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(boolean monotonic)` Creates an instance of the precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(boolean monotonic, double gsFactor)` Creates an instance of the precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(boolean monotonic, double gsFactor, Metric.AggregateFunction function)` Creates an instance of the precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(boolean monotonic, Metric.AggregateFunction function)` Creates an instance of the precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(double gsFactor)` Creates an instance of the non-monotonic precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(double gsFactor, Metric.AggregateFunction function)` Creates an instance of the non-monotonic precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecisionMetric(Metric.AggregateFunction function)` Creates an instance of the non-monotonic precision metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedEntropyMetric(double threshold)` Creates a potentially precomputed instance of the non-monotonic non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedEntropyMetric(double threshold, boolean monotonic)` Creates a potentially precomputed instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedEntropyMetric(double threshold, boolean monotonic, double gsFactor)` Creates a potentially precomputed instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedEntropyMetric(double threshold, boolean monotonic, double gsFactor, Metric.AggregateFunction function)` Creates a potentially precomputed instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedEntropyMetric(double threshold, boolean monotonic, Metric.AggregateFunction function)` Creates a potentially precomputed instance of the non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedEntropyMetric(double threshold, double gsFactor)` Creates a potentially precomputed instance of the non-monotonic non-uniform entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedLossMetric(double threshold)` Creates a potentially precomputed instance of the loss metric which treats generalization and suppression equally.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedLossMetric(double threshold, double gsFactor)` Creates a potentially precomputed instance of the loss metric with factors for weighting generalization and suppression.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedLossMetric(double threshold, double gsFactor, Metric.AggregateFunction function)` Creates a potentially precomputed instance of the loss metric with factors for weighting generalization and suppression.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedLossMetric(double threshold, Metric.AggregateFunction function)` Creates a potentially precomputed instance of the loss metric which treats generalization and suppression equally.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedNormalizedEntropyMetric(double threshold)` Creates a potentially precomputed instance of the normalized entropy metric.
    `static Metric<AbstractILMultiDimensional>` | `createPrecomputedNormalizedEntropyMetric(double threshold, Metric.AggregateFunction function)` Creates a potentially precomputed instance of the normalized entropy metric.
    `static MetricSDNMPublisherPayout` | `createPublisherPayoutMetric(boolean journalistAttackerModel)` Creates an instance of the model for maximizing publisher benefit in the game-theoretic privacy model based on a cost/benefit analysis.
    `static MetricSDNMPublisherPayout` | `createPublisherPayoutMetric(boolean journalistAttackerModel, double gsFactor)` Creates an instance of the model for maximizing publisher benefit in the game-theoretic privacy model based on a cost/benefit analysis.
    `static Metric<AbstractILMultiDimensional>` | `createStaticMetric(java.util.Map<java.lang.String,java.util.List<java.lang.Double>> loss)` Creates an instance of a metric with statically defined information loss.
    `static Metric<AbstractILMultiDimensional>` | `createStaticMetric(java.util.Map<java.lang.String,java.util.List<java.lang.Double>> loss, Metric.AggregateFunction function)` Creates an instance of a metric with statically defined information loss.
    `Metric.AggregateFunction` | `getAggregateFunction()` Returns the aggregate function of a multi-dimensional metric, null otherwise.
    `MetricConfiguration` | `getConfiguration()` Returns the configuration of this metric.
    `MetricDescription` | `getDescription()` Returns a description of this metric.
    `protected static MetricDescription` | `getDescription(Metric<?> metric)` Returns a description for the given metric, if there is any, null otherwise.
    `double` | `getGeneralizationFactor()` Returns the factor used weight generalized values.
    `double` | `getGeneralizationSuppressionFactor()` Returns the factor weighting generalization and suppression.
    `InformationLossWithBound<T>` | `getInformationLoss(Transformation node, HashGroupify groupify)` Evaluates the metric for the given node.
    `InformationLossWithBound<T>` | `getInformationLoss(Transformation node, HashGroupifyEntry entry)` Returns the information loss that would be induced by suppressing the given entry.
    `protected abstract InformationLossWithBound<T>` | `getInformationLossInternal(Transformation node, HashGroupify groupify)` Evaluates the metric for the given node.
    `protected abstract InformationLossWithBound<T>` | `getInformationLossInternal(Transformation node, HashGroupifyEntry entry)` Returns the information loss that would be induced by suppressing the given entry.
    `T` | `getLowerBound(Transformation node)` Returns a lower bound for the information loss for the given node.
    `T` | `getLowerBound(Transformation node, HashGroupify groupify)` Returns a lower bound for the information loss for the given node.
    `protected abstract T` | `getLowerBoundInternal(Transformation node)` Returns a lower bound for the information loss for the given node.
    `protected abstract T` | `getLowerBoundInternal(Transformation node, HashGroupify groupify)` Returns a lower bound for the information loss for the given node.
    `java.lang.String` | `getName()` Returns the name of metric.
    `protected int` | `getNumRecords(ARXConfiguration config, Data input)` Returns the number of records
    `protected RowSet` | `getSubset(ARXConfiguration config)` Returns the subset
    `double` | `getSuppressionFactor()` Returns the factor used to weight suppressed values.
    `void` | `initialize(DataManager manager, DataDefinition definition, Data input, GeneralizationHierarchy[] hierarchies, ARXConfiguration config)` Initializes the metric.
    `protected abstract void` | `initializeInternal(DataManager manager, DataDefinition definition, Data input, GeneralizationHierarchy[] hierarchies, ARXConfiguration config)` Implement this to initialize the metric.
    `boolean` | `isAbleToHandleMicroaggregation()` Returns whether this metric handles microaggregation
    `boolean` | `isGSFactorSupported()` Returns whether a generalization/suppression factor is supported
    `boolean` | `isIndependent()` Returns whether this metric requires the transformed data or groups to determine information loss.
    `boolean` | `isMonotonic(double suppressionLimit)` Returns whether this model is monotonic under the given suppression limit.
    `boolean` | `isMonotonicWithGeneralization()` Returns false if the metric is non-monotonic when using generalization.
    `boolean` | `isMonotonicWithSuppression()` Returns false if the metric is non-monotonic when using suppression.
    `boolean` | `isMultiDimensional()` Returns true if the metric is multi-dimensional.
    `boolean` | `isPrecomputed()` Returns whether the metric is precomputed
    `boolean` | `isWeighted()` Returns true if the metric is weighted.
    `static java.util.List<MetricDescription>` | `list()` Returns a list of all available metrics for information loss.
    `abstract ElementData` | `render(ARXConfiguration config)` Renders the privacy model
    `protected double` | `round(double value)` Ignore anything but the first DIGITS digits.
    `java.lang.String` | `toString()` Returns the name of metric.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Metric

          protected Metric(boolean monotonicWithGeneralization,
                boolean monotonicWithSuppression,
                boolean independent,
                double gsFactor)

      Create a new metric.
      Parameters:
        `monotonicWithGeneralization` -
        `monotonicWithSuppression` -
        `independent` -
        `gsFactor` -

  - ### Method Detail

    - #### createAECSMetric

          public static Metric<ILSingleDimensional> createAECSMetric()

      Creates a new instance of the AECS metric.
      Returns:

    - #### createAECSMetric

          public static Metric<ILSingleDimensional> createAECSMetric(double gsFactor)

      Creates a new instance of the AECS metric.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createAmbiguityMetric

          public static Metric<ILSingleDimensional> createAmbiguityMetric()

      Creates an instance of the ambiguity metric.
      Returns:

    - #### createDiscernabilityMetric

          public static Metric<ILSingleDimensional> createDiscernabilityMetric()

      Creates an instance of the discernability metric.
      Returns:

    - #### createDiscernabilityMetric

          public static Metric<ILSingleDimensional> createDiscernabilityMetric(boolean monotonic)

      Creates an instance of the discernability metric. The monotonic variant is DM*.
      Parameters:
        `monotonic` - If set to true, the monotonic variant (DM*) will be created
      Returns:

    - #### createEntropyBasedInformationLossMetric

          public static MetricSDNMEntropyBasedInformationLoss createEntropyBasedInformationLossMetric()

      Creates an instance of the entropy-based information loss metric, which will treat generalization and suppression equally.
      Returns:

    - #### createEntropyBasedInformationLossMetric

          public static MetricSDNMEntropyBasedInformationLoss createEntropyBasedInformationLossMetric(double gsFactor)

      Creates an instance of the entropy-based information loss metric.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createEntropyMetric

          public static Metric<AbstractILMultiDimensional> createEntropyMetric()

      Creates an instance of the non-monotonic non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Returns:

    - #### createEntropyMetric

          public static Metric<AbstractILMultiDimensional> createEntropyMetric(boolean monotonic)

      Creates an instance of the non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
      Returns:

    - #### createEntropyMetric

          public static Metric<AbstractILMultiDimensional> createEntropyMetric(boolean monotonic,
                                                               Metric.AggregateFunction function)

      Creates an instance of the non-uniform entropy metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `function` - The aggregate function to be used for comparing results
      Returns:

    - #### createEntropyMetric

          public static Metric<AbstractILMultiDimensional> createEntropyMetric(boolean monotonic,
                                                               double gsFactor)

      Creates an instance of the non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `monotonic` - If set to true, the monotonic variant of the metric will be created
      Returns:

    - #### createEntropyMetric

          public static Metric<AbstractILMultiDimensional> createEntropyMetric(boolean monotonic,
                                                               double gsFactor,
                                                               Metric.AggregateFunction function)

      Creates an instance of the non-uniform entropy metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `function` - The aggregate function to be used for comparing results
      Returns:

    - #### createEntropyMetric

          public static Metric<AbstractILMultiDimensional> createEntropyMetric(double gsFactor)

      Creates an instance of the non-monotonic non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createHeightMetric

          public static Metric<AbstractILMultiDimensional> createHeightMetric()

      Creates an instance of the height metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Returns:

    - #### createHeightMetric

          public static Metric<AbstractILMultiDimensional> createHeightMetric(Metric.AggregateFunction function)

      Creates an instance of the height metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createKLDivergenceMetric

          public static Metric<ILSingleDimensional> createKLDivergenceMetric()

      Creates an instance of the KL Divergence metric.
      Returns:

    - #### createLossMetric

          public static Metric<AbstractILMultiDimensional> createLossMetric()

      Creates an instance of the loss metric which treats generalization and suppression equally. The default aggregate function, which is the rank function, will be used. This metric will respect attribute weights defined in the configuration.
      Returns:

    - #### createLossMetric

          public static Metric<AbstractILMultiDimensional> createLossMetric(Metric.AggregateFunction function)

      Creates an instance of the loss metric which treats generalization and suppression equally. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createLossMetric

          public static Metric<AbstractILMultiDimensional> createLossMetric(double gsFactor)

      Creates an instance of the loss metric with factors for weighting generalization and suppression. The default aggregate function, which is the rank function, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createLossMetric

          public static Metric<AbstractILMultiDimensional> createLossMetric(double gsFactor,
                                                            Metric.AggregateFunction function)

      Creates an instance of the loss metric with factors for weighting generalization and suppression. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createMetric

          public static Metric<?> createMetric(Metric<?> metric,
                               int minLevel,
                               int maxLevel)

      This method supports backwards compatibility. It will transform implementations from version 1 to implementations from version 2, if necessary.
      Parameters:
        `metric` -
        `minLevel` -
        `maxLevel` -
      Returns:

    - #### createNormalizedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createNormalizedEntropyMetric()

      Creates an instance of the normalized entropy metric. The default aggregate function, which is the sum function, will be used. This metric will respect attribute weights defined in the configuration.
      Returns:

    - #### createNormalizedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createNormalizedEntropyMetric(Metric.AggregateFunction function)

      Creates an instance of the normalized entropy metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric()

      Creates an instance of the non-monotonic precision metric. The default aggregate function, which is the arithmetic mean, will be used. This metric will respect attribute weights defined in the configuration.
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(Metric.AggregateFunction function)

      Creates an instance of the non-monotonic precision metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(boolean monotonic)

      Creates an instance of the precision metric. The default aggregate function, which is the arithmetic mean, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(boolean monotonic,
                                                                 Metric.AggregateFunction function)

      Creates an instance of the precision metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `function` -
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(boolean monotonic,
                                                                 double gsFactor)

      Creates an instance of the precision metric. The default aggregate function, which is the arithmetic mean, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(boolean monotonic,
                                                                 double gsFactor,
                                                                 Metric.AggregateFunction function)

      Creates an instance of the precision metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `function` -
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(double gsFactor)

      Creates an instance of the non-monotonic precision metric. The default aggregate function, which is the arithmetic mean, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createPrecisionMetric

          public static Metric<AbstractILMultiDimensional> createPrecisionMetric(double gsFactor,
                                                                 Metric.AggregateFunction function)

      Creates an instance of the non-monotonic precision metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `function` - The aggregate function to use for comparing results
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createPrecomputedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold)

      Creates a potentially precomputed instance of the non-monotonic non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
      Returns:

    - #### createPrecomputedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold,
                                                                          boolean monotonic)

      Creates a potentially precomputed instance of the non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `monotonic` - If set to true, the monotonic variant of the metric will be created
      Returns:

    - #### createPrecomputedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold,
                                                                          boolean monotonic,
                                                                          Metric.AggregateFunction function)

      Creates a potentially precomputed instance of the non-uniform entropy metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `function` - The aggregate function to be used for comparing results
      Returns:

    - #### createPrecomputedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold,
                                                                          boolean monotonic,
                                                                          double gsFactor)

      Creates a potentially precomputed instance of the non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `monotonic` - If set to true, the monotonic variant of the metric will be created
      Returns:

    - #### createPrecomputedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold,
                                                                          boolean monotonic,
                                                                          double gsFactor,
                                                                          Metric.AggregateFunction function)

      Creates a potentially precomputed instance of the non-uniform entropy metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `monotonic` - If set to true, the monotonic variant of the metric will be created
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `function` - The aggregate function to be used for comparing results
      Returns:

    - #### createPrecomputedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold,
                                                                          double gsFactor)

      Creates a potentially precomputed instance of the non-monotonic non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createPrecomputedLossMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedLossMetric(double threshold)

      Creates a potentially precomputed instance of the loss metric which treats generalization and suppression equally. The default aggregate function, which is the rank function, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
      Returns:

    - #### createPrecomputedLossMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedLossMetric(double threshold,
                                                                       Metric.AggregateFunction function)

      Creates a potentially precomputed instance of the loss metric which treats generalization and suppression equally. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createPrecomputedLossMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedLossMetric(double threshold,
                                                                       double gsFactor)

      Creates a potentially precomputed instance of the loss metric with factors for weighting generalization and suppression. The default aggregate function, which is the rank function, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createPrecomputedLossMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedLossMetric(double threshold,
                                                                       double gsFactor,
                                                                       Metric.AggregateFunction function)

      Creates a potentially precomputed instance of the loss metric with factors for weighting generalization and suppression. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createPrecomputedNormalizedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedNormalizedEntropyMetric(double threshold)

      Creates a potentially precomputed instance of the normalized entropy metric. The default aggregate function, which is the sum function, will be used. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
      Returns:

    - #### createPrecomputedNormalizedEntropyMetric

          public static Metric<AbstractILMultiDimensional> createPrecomputedNormalizedEntropyMetric(double threshold,
                                                                                    Metric.AggregateFunction function)

      Creates a potentially precomputed instance of the normalized entropy metric. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `threshold` - The precomputed variant of the metric will be used if #distinctValues / #rows <= threshold for all quasi-identifiers.
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### createPublisherPayoutMetric

          public static MetricSDNMPublisherPayout createPublisherPayoutMetric(boolean journalistAttackerModel)

      Creates an instance of the model for maximizing publisher benefit in the game-theoretic privacy model based on a cost/benefit analysis. The model treats generalization and suppression equally.
      Parameters:
        `journalistAttackerModel` - If set to true, the journalist attacker model will be assumed, the prosecutor model will be assumed, otherwise
      Returns:

    - #### createPublisherPayoutMetric

          public static MetricSDNMPublisherPayout createPublisherPayoutMetric(boolean journalistAttackerModel,
                                                              double gsFactor)

      Creates an instance of the model for maximizing publisher benefit in the game-theoretic privacy model based on a cost/benefit analysis.
      Parameters:
        `journalistAttackerModel` - If set to true, the journalist attacker model will be assumed, the prosecutor model will be assumed, otherwise
        `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
      Returns:

    - #### createStaticMetric

          public static Metric<AbstractILMultiDimensional> createStaticMetric(java.util.Map<java.lang.String,java.util.List<java.lang.Double>> loss)

      Creates an instance of a metric with statically defined information loss. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `loss` - User defined information loss per attribute
      Returns:

    - #### createStaticMetric

          public static Metric<AbstractILMultiDimensional> createStaticMetric(java.util.Map<java.lang.String,java.util.List<java.lang.Double>> loss,
                                                              Metric.AggregateFunction function)

      Creates an instance of a metric with statically defined information loss. This metric will respect attribute weights defined in the configuration.
      Parameters:
        `loss` - User defined information loss per attribute
        `function` - The aggregate function to use for comparing results
      Returns:

    - #### list

          public static java.util.List<MetricDescription> list()

      Returns a list of all available metrics for information loss.
      Returns:

    - #### getDescription

          protected static MetricDescription getDescription(Metric<?> metric)

      Returns a description for the given metric, if there is any, null otherwise.
      Parameters:
        `metric` -
      Returns:

    - #### createInstanceOfHighestScore

          public InformationLoss<?> createInstanceOfHighestScore()

      Returns an instance of the highest possible score. Lower is better.
      Returns:

    - #### createInstanceOfLowestScore

          public InformationLoss<?> createInstanceOfLowestScore()

      Returns an instance of the lowest possible score. Lower is better.
      Returns:

    - #### createMaxInformationLoss

          @Deprecated
          public abstract InformationLoss<?> createMaxInformationLoss()

      Deprecated.
      Returns an instance of the maximal value.
      Returns:

    - #### createMinInformationLoss

          @Deprecated
          public abstract InformationLoss<?> createMinInformationLoss()

      Deprecated.
      Returns an instance of the minimal value.
      Returns:

    - #### getAggregateFunction

          public Metric.AggregateFunction getAggregateFunction()

      Returns the aggregate function of a multi-dimensional metric, null otherwise.
      Returns:

    - #### getConfiguration

          public MetricConfiguration getConfiguration()

      Returns the configuration of this metric.
      Returns:

    - #### getDescription

          public MetricDescription getDescription()

      Returns a description of this metric.
      Returns:

    - #### getGeneralizationFactor

          public double getGeneralizationFactor()

      Returns the factor used weight generalized values.
      Returns:

    - #### getGeneralizationSuppressionFactor

          public double getGeneralizationSuppressionFactor()

      Returns the factor weighting generalization and suppression.
      Returns:
        A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.

    - #### getInformationLoss

          public final InformationLossWithBound<T> getInformationLoss(Transformation node,
                                                       HashGroupify groupify)

      Evaluates the metric for the given node.
      Parameters:
        `node` - The node for which to compute the information loss
        `groupify` - The groupify operator of the previous check
      Returns:
        the information loss

    - #### getInformationLoss

          public final InformationLossWithBound<T> getInformationLoss(Transformation node,
                                                       HashGroupifyEntry entry)

      Returns the information loss that would be induced by suppressing the given entry. The loss is not necessarily consistent with the loss that is computed by `getInformationLoss(node, groupify)` but is guaranteed to be comparable for different entries from the same groupify operator.
      Parameters:
        `entry` -
      Returns:

    - #### getLowerBound

          public T getLowerBound(Transformation node)

      Returns a lower bound for the information loss for the given node. This can be used to expose the results of monotonic shares of a metric, which can significantly speed-up the anonymization process. If no such metric exists, the method returns `null`.
      Parameters:
        `node` -
      Returns:

    - #### getLowerBound

          public T getLowerBound(Transformation node,
                        HashGroupify groupify)

      Returns a lower bound for the information loss for the given node. This can be used to expose the results of monotonic shares of a metric, which can significantly speed-up the anonymization process. If no such metric exists the method returns `null`.
      Parameters:
        `node` -
        `groupify` -
      Returns:

    - #### getName

          public java.lang.String getName()

      Returns the name of metric.
      Returns:

    - #### getSuppressionFactor

          public double getSuppressionFactor()

      Returns the factor used to weight suppressed values.
      Returns:

    - #### initialize

          public final void initialize(DataManager manager,
                        DataDefinition definition,
                        Data input,
                        GeneralizationHierarchy[] hierarchies,
                        ARXConfiguration config)

      Initializes the metric.
      Parameters:
        `manager` -
        `definition` -
        `input` -
        `hierarchies` -
        `config` -

    - #### isAbleToHandleMicroaggregation

          public boolean isAbleToHandleMicroaggregation()

      Returns whether this metric handles microaggregation
      Returns:

    - #### isGSFactorSupported

          public boolean isGSFactorSupported()

      Returns whether a generalization/suppression factor is supported
      Returns:

    - #### isIndependent

          public boolean isIndependent()

      Returns whether this metric requires the transformed data or groups to determine information loss.
      Returns:

    - #### isMonotonic

          public final boolean isMonotonic(double suppressionLimit)

      Returns whether this model is monotonic under the given suppression limit. Note: The suppression limit may be relative or absolute.
      Parameters:
        `suppressionLimit` -
      Returns:

    - #### isMonotonicWithGeneralization

          public final boolean isMonotonicWithGeneralization()

      Returns false if the metric is non-monotonic when using generalization.
      Returns:

    - #### isMonotonicWithSuppression

          public final boolean isMonotonicWithSuppression()

      Returns false if the metric is non-monotonic when using suppression.
      Returns:

    - #### isMultiDimensional

          public final boolean isMultiDimensional()

      Returns true if the metric is multi-dimensional.
      Returns:

    - #### isPrecomputed

          public boolean isPrecomputed()

      Returns whether the metric is precomputed
      Returns:

    - #### isWeighted

          public final boolean isWeighted()

      Returns true if the metric is weighted.
      Returns:

    - #### render

          public abstract ElementData render(ARXConfiguration config)

      Renders the privacy model
      Returns:

    - #### toString

          public java.lang.String toString()

      Returns the name of metric.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:

    - #### getInformationLossInternal

          protected abstract InformationLossWithBound<T> getInformationLossInternal(Transformation node,
                                                               HashGroupify groupify)

      Evaluates the metric for the given node.
      Parameters:
        `node` - The node for which to compute the information loss
        `groupify` - The groupify operator of the previous check
      Returns:
        the double

    - #### getInformationLossInternal

          protected abstract InformationLossWithBound<T> getInformationLossInternal(Transformation node,
                                                               HashGroupifyEntry entry)

      Returns the information loss that would be induced by suppressing the given entry. The loss is not necessarily consistent with the loss that is computed by `getInformationLoss(node, groupify)` but is guaranteed to be comparable for different entries from the same groupify operator.
      Parameters:
        `entry` -
      Returns:

    - #### getLowerBoundInternal

          protected abstract T getLowerBoundInternal(Transformation node)

      Returns a lower bound for the information loss for the given node. This can be used to expose the results of monotonic shares of a metric, which can significantly speed-up the anonymization process. If no such metric exists, simply return `null`.
      Parameters:
        `node` -
      Returns:

    - #### getLowerBoundInternal

          protected abstract T getLowerBoundInternal(Transformation node,
                                HashGroupify groupify)

      Returns a lower bound for the information loss for the given node. This can be used to expose the results of monotonic shares of a metric, which can significantly speed-up the anonymization process. If no such metric exists, simply return `null`.
      This variant of the method allows computing a monotonic share based on a groupified data representation. IMPORTANT NOTE: The groups may not have been classified correctly when the method is called, i.e., HashGroupifyEntry.isNotOutlier may not be set correctly!
      Parameters:
        `node` -
        `groupify` -
      Returns:

    - #### getNumRecords

          protected int getNumRecords(ARXConfiguration config,
                          Data input)

      Returns the number of records
      Parameters:
        `config` -
        `input` -
      Returns:

    - #### getSubset

          protected RowSet getSubset(ARXConfiguration config)

      Returns the subset
      Parameters:
        `config` -
        `input` -
      Returns:

    - #### initializeInternal

          protected abstract void initializeInternal(DataManager manager,
                                DataDefinition definition,
                                Data input,
                                GeneralizationHierarchy[] hierarchies,
                                ARXConfiguration config)

      Implement this to initialize the metric.
      Parameters:
        `manager` -
        `definition` -
        `input` -
        `hierarchies` -
        `config` -

    - #### round

          protected double round(double value)

      Ignore anything but the first DIGITS digits.
      Parameters:
        `value` -
      Returns: