# MetricMDNMLoss
Date: 2019-11-17

org.deidentifier.arx.metric.v2

## Class MetricMDNMLoss

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

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  MetricMDNMLossPrecomputed

    public class MetricMDNMLoss
    extends AbstractMetricMultiDimensional

This class implements a variant of the Loss metric.

Author:
  Fabian Prasser, Raffael Bild
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
`MetricMDNMLoss()` Default constructor which treats all transformation methods equally.
`MetricMDNMLoss(double gsFactor, Metric.AggregateFunction function)` A constructor that allows to define a factor weighting generalization and suppression.
`MetricMDNMLoss(Metric.AggregateFunction function)` Default constructor which treats all transformation methods equally.

### Method Summary

All Methods Instance Methods Concrete Methods
`MetricConfiguration` `getConfiguration()` Returns the configuration of this metric.
`double` `getGeneralizationFactor()` Returns the factor used weight generalized values.
`double` `getGeneralizationSuppressionFactor()` Returns the factor weighting generalization and suppression.
`java.lang.String` `getName()` Returns the name of metric.
`ILScore` `getScore(Transformation<?> node, HashGroupify groupify)` Calculates the score.
`double` `getSuppressionFactor()` Returns the factor used to weight suppressed values.
`boolean` `isAbleToHandleMicroaggregation()` Returns whether this metric handles microaggregation
`boolean` `isGSFactorSupported()` Returns whether a generalization/suppression factor is supported
`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, getInformationLoss, getInformationLoss, getLowerBound, getLowerBound, initialize, isAbleToHandleClusteredMicroaggregation, isIndependent, isMonotonic, isMonotonicWithGeneralization, isMonotonicWithSuppression, isMultiDimensional, isPrecomputed, isWeighted, list`

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

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

### Constructor Detail

#### MetricMDNMLoss

    public MetricMDNMLoss()

Default constructor which treats all transformation methods equally.

#### MetricMDNMLoss

    public MetricMDNMLoss(Metric.AggregateFunction function)

Default constructor which treats all transformation methods equally.

Parameters:
  `function` -

#### MetricMDNMLoss

    public MetricMDNMLoss(double gsFactor,
                          Metric.AggregateFunction function)

A constructor that allows to define a factor weighting generalization and suppression.

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` -

### Method Detail

#### getConfiguration

    public MetricConfiguration getConfiguration()

Returns the configuration of this metric.

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

#### getGeneralizationFactor

    public double getGeneralizationFactor()

Description copied from class: `Metric`
Returns the factor used weight generalized values.

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

#### getGeneralizationSuppressionFactor

    public double getGeneralizationSuppressionFactor()

Description copied from class: `Metric`
Returns the factor weighting generalization and suppression.

Overrides:
  `getGeneralizationSuppressionFactor` in class `Metric<AbstractILMultiDimensional>`
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.

#### getName

    public java.lang.String getName()

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

Overrides:
  `getName` 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:

#### getSuppressionFactor

    public double getSuppressionFactor()

Description copied from class: `Metric`
Returns the factor used to weight suppressed values.

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

#### isAbleToHandleMicroaggregation

    public boolean isAbleToHandleMicroaggregation()

Description copied from class: `Metric`
Returns whether this metric handles microaggregation

Overrides:
  `isAbleToHandleMicroaggregation` 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:

#### 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>`