# AbstractMetricSingleDimensional (ARX GUI Documentation)

org.deidentifier.arx.metric.v2

## Class AbstractMetricSingleDimensional

- java.lang.Object
- - org.deidentifier.arx.metric.Metric<ILSingleDimensional>
  - - org.deidentifier.arx.metric.v2.AbstractMetricSingleDimensional

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    MetricSDAECS, MetricSDNMAmbiguity, MetricSDNMDiscernability, MetricSDNMEntropyBasedInformationLoss, MetricSDNMKLDivergence, MetricSDNMPublisherPayout

      public abstract class AbstractMetricSingleDimensional
      extends Metric<ILSingleDimensional>

  This class provides an abstract skeleton for the implementation of single-dimensional metrics.
  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` | `AbstractMetricSingleDimensional(boolean monotonicWithGeneralization, boolean monotonicWithSuppression, boolean independent)` Creates a new instance.
    `protected` | `AbstractMetricSingleDimensional(boolean monotonicWithGeneralization, boolean monotonicWithSuppression, boolean independent, double gsFactor)` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ILSingleDimensional` | `createInformationLoss(double loss)` Create a loss object
    `ILSingleDimensionalWithBound` | `createInformationLoss(double loss, double bound)` Create a loss object
    `InformationLoss<?>` | `createMaxInformationLoss()` Returns an instance of the maximal value.
    `InformationLoss<?>` | `createMinInformationLoss()` Returns an instance of the minimal value.
    `protected int` | `getDimensions()` Returns the number of dimensions.
    `protected int` | `getDimensionsAggregated()` Returns the number of dimensions.
    `protected int` | `getDimensionsGeneralized()` Returns the number of dimensions.
    `protected int[]` | `getMicroaggregationDomainSizes()` Needed for microaggregation
    `protected org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction[]` | `getMicroaggregationFunctions()` Needed for microaggregation
    `protected int` | `getMicroaggregationStartIndex()` Needed for microaggregation
    `protected java.lang.Double` | `getNumTuples()` Returns the number of rows in the dataset or subset.
    `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.
    `protected void` | `setNumTuples(java.lang.Double tuples)` Returns the number of rows in the dataset or subset.

    - ### 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, getLowerBoundInternal, getLowerBoundInternal, 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

    - #### AbstractMetricSingleDimensional

          protected AbstractMetricSingleDimensional(boolean monotonicWithGeneralization,
                                         boolean monotonicWithSuppression,
                                         boolean independent)

      Creates a new instance.
      Parameters:
        `monotonicWithGeneralization` -
        `monotonicWithSuppression` -
        `independent` -

    - #### AbstractMetricSingleDimensional

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

      Creates a new instance.
      Parameters:
        `monotonicWithGeneralization` -
        `monotonicWithSuppression` -
        `independent` -
        `gsFactor` -

  - ### Method Detail

    - #### createInformationLoss

          public ILSingleDimensional createInformationLoss(double loss)

      Create a loss object
      Parameters:
        `loss` -
      Returns:

    - #### createInformationLoss

          public ILSingleDimensionalWithBound createInformationLoss(double loss,
                                                           double bound)

      Create a loss object
      Parameters:
        `loss` -
        `bound` -
      Returns:

    - #### createMaxInformationLoss

          public InformationLoss<?> createMaxInformationLoss()

      Description copied from class: `Metric`
      Returns an instance of the maximal value.
      Specified by:
        `createMaxInformationLoss` in class `Metric<ILSingleDimensional>`
      Returns:

    - #### createMinInformationLoss

          public InformationLoss<?> createMinInformationLoss()

      Description copied from class: `Metric`
      Returns an instance of the minimal value.
      Specified by:
        `createMinInformationLoss` in class `Metric<ILSingleDimensional>`
      Returns:

    - #### getDimensions

          protected int getDimensions()

      Returns the number of dimensions.
      Returns:

    - #### getDimensionsAggregated

          protected int getDimensionsAggregated()

      Returns the number of dimensions.
      Returns:

    - #### getDimensionsGeneralized

          protected int getDimensionsGeneralized()

      Returns the number of dimensions.
      Returns:

    - #### getMicroaggregationDomainSizes

          protected int[] getMicroaggregationDomainSizes()

      Needed for microaggregation
      Returns:

    - #### getMicroaggregationFunctions

          protected org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction[] getMicroaggregationFunctions()

      Needed for microaggregation
      Returns:

    - #### getMicroaggregationStartIndex

          protected int getMicroaggregationStartIndex()

      Needed for microaggregation
      Returns:

    - #### getNumTuples

          protected java.lang.Double getNumTuples()

      Returns the number of rows in the dataset or subset.
      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<ILSingleDimensional>`

    - #### setNumTuples

          protected void setNumTuples(java.lang.Double tuples)

      Returns the number of rows in the dataset or subset.
      Parameters:
        `tuples` -