# MetricDefault (ARX GUI Documentation)

org.deidentifier.arx.metric

## Class MetricDefault

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

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    MetricAECS, MetricDM, MetricDMStar, MetricEntropy, MetricHeight

      public abstract class MetricDefault
      extends Metric<org.deidentifier.arx.metric.InformationLossDefault>

  This class provides an abstract skeleton for the implementation of metrics.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.deidentifier.arx.metric.Metric

      `Metric.AggregateFunction`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetricDefault(boolean monotonicWithGeneralization, boolean monotonicWithSuppression, boolean independent)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `InformationLoss<?>` | `createMaxInformationLoss()` Returns an instance of the maximal value.
    `InformationLoss<?>` | `createMinInformationLoss()` Returns an instance of the minimal value.
    `protected org.deidentifier.arx.metric.InformationLossDefault` | `getLowerBoundInternal(org.deidentifier.arx.framework.lattice.Transformation node)` Returns a lower bound for the information loss for the given node.
    `protected org.deidentifier.arx.metric.InformationLossDefault` | `getLowerBoundInternal(org.deidentifier.arx.framework.lattice.Transformation node, org.deidentifier.arx.framework.check.groupify.HashGroupify groupify)` Returns a lower bound for the information loss for the given node.
    `protected void` | `initializeInternal(org.deidentifier.arx.framework.data.DataManager manager, DataDefinition definition, org.deidentifier.arx.framework.data.Data input, org.deidentifier.arx.framework.data.GeneralizationHierarchy[] hierarchies, ARXConfiguration config)` Implement this to initialize the metric.

    - ### Methods inherited from class org.deidentifier.arx.metric.Metric

      `createAECSMetric, createAECSMetric, createAmbiguityMetric, createDiscernabilityMetric, createDiscernabilityMetric, createEntropyBasedInformationLossMetric, createEntropyBasedInformationLossMetric, createEntropyMetric, createEntropyMetric, createEntropyMetric, createEntropyMetric, createEntropyMetric, createEntropyMetric, createHeightMetric, createHeightMetric, createInstanceOfHighestScore, createInstanceOfLowestScore, createKLDivergenceMetric, createLossMetric, createLossMetric, createLossMetric, createLossMetric, createMetric, createNormalizedEntropyMetric, createNormalizedEntropyMetric, createPrecisionMetric, createPrecisionMetric, createPrecisionMetric, createPrecisionMetric, createPrecisionMetric, createPrecisionMetric, createPrecisionMetric, createPrecisionMetric, createPrecomputedEntropyMetric, createPrecomputedEntropyMetric, createPrecomputedEntropyMetric, createPrecomputedEntropyMetric, createPrecomputedEntropyMetric, createPrecomputedEntropyMetric, createPrecomputedLossMetric, createPrecomputedLossMetric, createPrecomputedLossMetric, createPrecomputedLossMetric, createPrecomputedNormalizedEntropyMetric, createPrecomputedNormalizedEntropyMetric, createPublisherPayoutMetric, createPublisherPayoutMetric, createStaticMetric, createStaticMetric, getAggregateFunction, getConfiguration, getDescription, getDescription, getGeneralizationFactor, getGeneralizationSuppressionFactor, getInformationLoss, getInformationLoss, getInformationLossInternal, getInformationLossInternal, getLowerBound, getLowerBound, getName, getNumRecords, getSubset, getSuppressionFactor, initialize, isAbleToHandleMicroaggregation, isGSFactorSupported, isIndependent, isMonotonic, isMonotonicWithGeneralization, isMonotonicWithSuppression, isMultiDimensional, isPrecomputed, isWeighted, list, render, round, toString`

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

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

- - ### Constructor Detail

    - #### MetricDefault

          public MetricDefault(boolean monotonicWithGeneralization,
                       boolean monotonicWithSuppression,
                       boolean independent)

      Parameters:
        `monotonicWithGeneralization` -
        `monotonicWithSuppression` -
        `independent` -

  - ### Method Detail

    - #### createMaxInformationLoss

          public InformationLoss<?> createMaxInformationLoss()

      Description copied from class: `Metric`
      Returns an instance of the maximal value.
      Specified by:
        `createMaxInformationLoss` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`
      Returns:

    - #### createMinInformationLoss

          public InformationLoss<?> createMinInformationLoss()

      Description copied from class: `Metric`
      Returns an instance of the minimal value.
      Specified by:
        `createMinInformationLoss` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`
      Returns:

    - #### getLowerBoundInternal

          protected org.deidentifier.arx.metric.InformationLossDefault getLowerBoundInternal(org.deidentifier.arx.framework.lattice.Transformation node)

      Description copied from class: `Metric`
      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`.
      Specified by:
        `getLowerBoundInternal` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`
      Returns:

    - #### getLowerBoundInternal

          protected org.deidentifier.arx.metric.InformationLossDefault getLowerBoundInternal(org.deidentifier.arx.framework.lattice.Transformation node,
                                                                                 org.deidentifier.arx.framework.check.groupify.HashGroupify groupify)

      Description copied from class: `Metric`
      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!
      Specified by:
        `getLowerBoundInternal` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`
      Returns:

    - #### initializeInternal

          protected void initializeInternal(org.deidentifier.arx.framework.data.DataManager manager,
                                DataDefinition definition,
                                org.deidentifier.arx.framework.data.Data input,
                                org.deidentifier.arx.framework.data.GeneralizationHierarchy[] hierarchies,
                                ARXConfiguration config)

      Description copied from class: `Metric`
      Implement this to initialize the metric.
      Specified by:
        `initializeInternal` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`