org.deidentifier.arx.framework.check.distribution

## Class DistributionAggregateFunction

- java.lang.Object
- - org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  DistributionAggregateFunction.DistributionAggregateFunctionArithmeticMean, DistributionAggregateFunction.DistributionAggregateFunctionGeometricMean, DistributionAggregateFunction.DistributionAggregateFunctionInterval, DistributionAggregateFunction.DistributionAggregateFunctionMedian, DistributionAggregateFunction.DistributionAggregateFunctionMode

    public abstract class DistributionAggregateFunction
    extends java.lang.Object
    implements java.io.Serializable

This abstract class represents a function that aggregates values from a frequency distribution

Author:
  Florian Kohlmayer, Fabian Prasser
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `DistributionAggregateFunction.DistributionAggregateFunctionArithmeticMean` This class calculates the arithmetic mean for a given distribution.
`static class` `DistributionAggregateFunction.DistributionAggregateFunctionGeometricMean` This class calculates the geometric mean for a given distribution.
`static class` `DistributionAggregateFunction.DistributionAggregateFunctionInterval` This class calculates the mode for a given distribution.
`static class` `DistributionAggregateFunction.DistributionAggregateFunctionMedian` This class calculates the median for a given distribution.
`static class` `DistributionAggregateFunction.DistributionAggregateFunctionMode` This class calculates the mode for a given distribution.

### Constructor Summary

Constructors
Constructor and Description
`DistributionAggregateFunction(boolean ignoreMissingData, boolean typePreserving)` Instantiates a new function.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract <T> java.lang.String` `aggregate(Distribution distribution)` This function returns an aggregate value.
`abstract DistributionAggregateFunction` `clone()` Clones this function
`abstract <T> double` `getError(Distribution distribution)` Returns the normalized error induced by aggregation.
`<T> double` `getInformationLoss(Distribution distribution)` This will return the normalized number of aggregated values in range [1/#distinct-values, 1].
`void` `initialize(java.lang.String[] dictionary, DataType<?> type)` Initializes the function
`boolean` `isTypePreserving()` Returns whether this is a type-preserving function

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

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

### Constructor Detail

#### DistributionAggregateFunction

    public DistributionAggregateFunction(boolean ignoreMissingData,
                                         boolean typePreserving)

Instantiates a new function.

Parameters:
  `ignoreMissingData` -
  `typePreserving` -

### Method Detail

#### aggregate

    public abstract <T> java.lang.String aggregate(Distribution distribution)

This function returns an aggregate value.

Parameters:
  `distribution` -
  `dictionary` -
  `type` -
Returns:
  the string

#### clone

    public abstract DistributionAggregateFunction clone()

Clones this function

Overrides:
  `clone` in class `java.lang.Object`

#### getError

    public abstract <T> double getError(Distribution distribution)

Returns the normalized error induced by aggregation. In most cases this will be the mean squared error normalized into [0,1]. In case of generalization, it will return the normalized generalization level (also called generalization intensity). In case of intervals, it will return the normalized number of aggregated values.

Parameters:
  `distribution` -
Returns:

#### getInformationLoss

    public <T> double getInformationLoss(Distribution distribution)

This will return the normalized number of aggregated values in range [1/#distinct-values, 1].

Parameters:
  `distribution` -
Returns:

#### initialize

    public void initialize(java.lang.String[] dictionary,
                           DataType<?> type)

Initializes the function

Parameters:
  `dictionary` -
  `type` -
  `hierarchy` -

#### isTypePreserving

    public boolean isTypePreserving()

Returns whether this is a type-preserving function

Returns: