# MetricDMStar (ARX Developer Documentation)

org.deidentifier.arx.metric

## Class MetricDMStar

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

- All Implemented Interfaces:
    java.io.Serializable

      public class MetricDMStar
      extends MetricDefault

  This class provides an implementation of the DM* metric (monotonic variant of the Discernability Metric).
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `Metric.AggregateFunction`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MetricDMStar()` Creates a new instance.

  - ### 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 InformationLossWithBound<org.deidentifier.arx.metric.InformationLossDefault>` | `getInformationLossInternal(Transformation node, HashGroupify g)` Evaluates the metric for the given node.
    `protected InformationLossWithBound<org.deidentifier.arx.metric.InformationLossDefault>` | `getInformationLossInternal(Transformation node, HashGroupifyEntry entry)` Returns the information loss that would be induced by suppressing the given entry.
    `protected org.deidentifier.arx.metric.InformationLossDefault` | `getLowerBoundInternal(Transformation node)` Returns a lower bound for the information loss for the given node.
    `protected org.deidentifier.arx.metric.InformationLossDefault` | `getLowerBoundInternal(Transformation node, HashGroupify groupify)` Returns a lower bound for the information loss for the given node.
    `protected double` | `getRowCount()` Returns the current row count.
    `protected void` | `initializeInternal(DataManager manager, DataDefinition definition, Data input, GeneralizationHierarchy[] hierarchies, ARXConfiguration config)` Implement this to initialize the metric.
    `ElementData` | `render(ARXConfiguration config)` Renders the privacy model
    `java.lang.String` | `toString()` Returns the name of 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, getLowerBound, getLowerBound, getName, getNumRecords, getSubset, getSuppressionFactor, initialize, isAbleToHandleMicroaggregation, isGSFactorSupported, isIndependent, isMonotonic, isMonotonicWithGeneralization, isMonotonicWithSuppression, isMultiDimensional, isPrecomputed, isWeighted, list, round`

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

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

- - ### Constructor Detail

    - #### MetricDMStar

          protected MetricDMStar()

      Creates a new instance.

  - ### Method Detail

    - #### createMaxInformationLoss

          public InformationLoss<?> createMaxInformationLoss()

      Description copied from class: `Metric`
      Returns an instance of the maximal value.
      Overrides:
        `createMaxInformationLoss` in class `MetricDefault`
      Returns:

    - #### createMinInformationLoss

          public InformationLoss<?> createMinInformationLoss()

      Description copied from class: `Metric`
      Returns an instance of the minimal value.
      Overrides:
        `createMinInformationLoss` in class `MetricDefault`
      Returns:

    - #### render

          public ElementData render(ARXConfiguration config)

      Description copied from class: `Metric`
      Renders the privacy model
      Specified by:
        `render` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`
      Returns:

    - #### toString

          public java.lang.String toString()

      Description copied from class: `Metric`
      Returns the name of metric.
      Overrides:
        `toString` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`

    - #### getInformationLossInternal

          protected InformationLossWithBound<org.deidentifier.arx.metric.InformationLossDefault> getInformationLossInternal(Transformation node,
                                                                                                                HashGroupify g)

      Description copied from class: `Metric`
      Evaluates the metric for the given node.
      Specified by:
        `getInformationLossInternal` in class `Metric<org.deidentifier.arx.metric.InformationLossDefault>`
      Parameters:
        `node` - The node for which to compute the information loss
        `g` - The groupify operator of the previous check
      Returns:
        the double

    - #### getInformationLossInternal

          protected InformationLossWithBound<org.deidentifier.arx.metric.InformationLossDefault> getInformationLossInternal(Transformation node,
                                                                                                                HashGroupifyEntry entry)

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

    - #### getLowerBoundInternal

          protected org.deidentifier.arx.metric.InformationLossDefault getLowerBoundInternal(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`.
      Overrides:
        `getLowerBoundInternal` in class `MetricDefault`
      Returns:

    - #### getLowerBoundInternal

          protected org.deidentifier.arx.metric.InformationLossDefault getLowerBoundInternal(Transformation node,
                                                                                 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!
      Overrides:
        `getLowerBoundInternal` in class `MetricDefault`
      Returns:

    - #### getRowCount

          protected double getRowCount()

      Returns the current row count.
      Returns:

    - #### initializeInternal

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

      Description copied from class: `Metric`
      Implement this to initialize the metric.
      Overrides:
        `initializeInternal` in class `MetricDefault`