# MetricMDNUEntropyPrecomputed
Date: 2019-11-17

org.deidentifier.arx.metric.v2

## Class MetricMDNUEntropyPrecomputed

- java.lang.Object
- - org.deidentifier.arx.metric.Metric<AbstractILMultiDimensional>
  - - org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensional
    - - org.deidentifier.arx.metric.v2.MetricMDNUEntropyPrecomputed

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  MetricMDNUEntropy, MetricMDNUNMEntropyPrecomputed

    public class MetricMDNUEntropyPrecomputed
    extends AbstractMetricMultiDimensional

This class provides an efficient implementation of the non-uniform entropy metric. It avoids a cell-by-cell process by utilizing a three-dimensional array that maps identifiers to their frequency for all quasi-identifiers and generalization levels. It further reduces the overhead induced by subsequent calls by caching the results for previous columns and generalization levels. See:
A. De Waal and L. Willenborg: "Information loss through global recoding and local suppression" Netherlands Off Stat, vol. 14, pp. 17–20, 1999.

Author:
  Fabian Prasser, Florian Kohlmayer
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
`MetricMDNUEntropyPrecomputed(boolean monotonicWithGeneralization, boolean monotonicWithSuppression, boolean independent, double gsFactor, Metric.AggregateFunction function)` Precomputed.

### Method Summary

All Methods Instance Methods Concrete Methods
`MetricConfiguration` `getConfiguration()` Returns the configuration of this metric.
`ILScore` `getScore(Transformation<?> node, HashGroupify groupify)` Calculates the score.
`boolean` `isGSFactorSupported()` Returns whether a generalization/suppression factor is supported
`boolean` `isPrecomputed()` Returns whether the metric is precomputed
`boolean` `isScoreFunctionSupported()` Returns whether the metric provides a score function
`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.v2.AbstractMetricMultiDimensional

`createMaxInformationLoss, createMinInformationLoss, getAggregateFunction`

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

`createAECSMetric, createAECSMetric, createAmbiguityMetric, createClassificationMetric, createClassificationMetric, 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, getDescription, getGeneralizationFactor, getGeneralizationSuppressionFactor, getInformationLoss, getInformationLoss, getLowerBound, getLowerBound, getName, getSuppressionFactor, initialize, isAbleToHandleClusteredMicroaggregation, isAbleToHandleMicroaggregation, isIndependent, isMonotonic, isMonotonicWithGeneralization, isMonotonicWithSuppression, isMultiDimensional, isWeighted, list`

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

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

### Constructor Detail

#### MetricMDNUEntropyPrecomputed

    public MetricMDNUEntropyPrecomputed(boolean monotonicWithGeneralization,
                                        boolean monotonicWithSuppression,
                                        boolean independent,
                                        double gsFactor,
                                        Metric.AggregateFunction function)

Precomputed.

Parameters:
  `monotonicWithGeneralization` -
  `monotonicWithSuppression` -
  `independent` -
  `gsFactor` -
  `function` -

### Method Detail

#### getConfiguration

    public MetricConfiguration getConfiguration()

Returns the configuration of this metric.

Overrides:
  `getConfiguration` in class `Metric<AbstractILMultiDimensional>`
Returns:

#### getScore

    public ILScore getScore(Transformation<?> node,
                            HashGroupify groupify)

Description copied from class: `Metric`
Calculates the score. Note: All score functions are expected to return a score value divided by the sensitivity of the score function.

Overrides:
  `getScore` in class `Metric<AbstractILMultiDimensional>`
Returns:

#### isGSFactorSupported

    public boolean isGSFactorSupported()

Description copied from class: `Metric`
Returns whether a generalization/suppression factor is supported

Overrides:
  `isGSFactorSupported` in class `Metric<AbstractILMultiDimensional>`
Returns:

#### isPrecomputed

    public boolean isPrecomputed()

Description copied from class: `Metric`
Returns whether the metric is precomputed

Overrides:
  `isPrecomputed` in class `Metric<AbstractILMultiDimensional>`
Returns:

#### isScoreFunctionSupported

    public boolean isScoreFunctionSupported()

Description copied from class: `Metric`
Returns whether the metric provides a score function

Overrides:
  `isScoreFunctionSupported` in class `Metric<AbstractILMultiDimensional>`
Returns:

#### render

    public ElementData render(ARXConfiguration config)

Description copied from class: `Metric`
Renders the privacy model

Specified by:
  `render` in class `Metric<AbstractILMultiDimensional>`
Returns:

#### toString

    public java.lang.String toString()

Description copied from class: `Metric`
Returns the name of metric.

Overrides:
  `toString` in class `Metric<AbstractILMultiDimensional>`