org.deidentifier.arx.aggregates

## Class StatisticsBuilder

- java.lang.Object
- - org.deidentifier.arx.aggregates.StatisticsBuilder

    public class StatisticsBuilder
    extends java.lang.Object

A class offering basic descriptive statistics about data handles.

Author:
  Fabian Prasser

### Constructor Summary

Constructors
Constructor and Description
`StatisticsBuilder(DataHandleInternal handle)` Creates a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`StatisticsClassification` `getClassificationPerformance(java.lang.String[] features, java.lang.String clazz, ARXClassificationConfiguration<?> config)` Creates a new set of statistics for the given classification task
`StatisticsClassification` `getClassificationPerformance(java.lang.String[] features, java.lang.String clazz, ARXClassificationConfiguration<?> config, ARXFeatureScaling scaling)` Creates a new set of statistics for the given classification task
`StatisticsClassification` `getClassificationPerformance(java.lang.String clazz, ARXClassificationConfiguration<?> config)` Creates a new set of statistics for the given classification task
`StatisticsContingencyTable` `getContingencyTable(int column1, boolean orderFromDefinition1, int column2, boolean orderFromDefinition2)` Returns a contingency table for the given columns.
`StatisticsContingencyTable` `getContingencyTable(int column1, int column2)` Returns a contingency table for the given columns.
`StatisticsContingencyTable` `getContingencyTable(int column1, int size1, boolean orderFromDefinition1, int column2, int size2, boolean orderFromDefinition2)` Returns a contingency table for the given columns.
`StatisticsContingencyTable` `getContingencyTable(int column1, int size1, int column2, int size2)` Returns a contingency table for the given columns.
`StatisticsContingencyTable` `getContingencyTable(int column1, int size1, java.lang.String[][] hierarchy1, int column2, int size2, java.lang.String[][] hierarchy2)` Returns a contingency table for the given columns.
`StatisticsContingencyTable` `getContingencyTable(int column1, java.lang.String[][] hierarchy1, int column2, java.lang.String[][] hierarchy2)` Returns a contingency table for the given columns.
`java.lang.String[]` `getDistinctValues(int column)` Returns the distinct set of data items from the given column.
`java.lang.String[]` `getDistinctValuesOrdered(int column)` Returns an ordered list of the distinct set of data items from the given column.
`java.lang.String[]` `getDistinctValuesOrdered(int column, boolean orderFromDefinition)` Returns an ordered list of the distinct set of data items from the given column.
`java.lang.String[]` `getDistinctValuesOrdered(int column, java.lang.String[][] hierarchy)` Returns an ordered list of the distinct set of data items from the given column.
`StatisticsEquivalenceClasses` `getEquivalenceClassStatistics()` Returns statistics about the equivalence classes.
`StatisticsFrequencyDistribution` `getFrequencyDistribution(int column)` Returns a frequency distribution for the values in the given column.
`StatisticsFrequencyDistribution` `getFrequencyDistribution(int column, boolean orderFromDefinition)` Returns a frequency distribution for the values in the given column.
`StatisticsFrequencyDistribution` `getFrequencyDistribution(int column, java.lang.String[][] hierarchy)` Returns a frequency distribution for the values in the given column.
`StatisticsBuilderInterruptible` `getInterruptibleInstance()` Returns an interruptible instance of this object.
`StatisticsQuality` `getQualityStatistics()` Returns data quality according to various models.
`StatisticsQuality` `getQualityStatistics(DataHandle output)` Returns data quality according to various models.
`StatisticsQuality` `getQualityStatistics(DataHandle output, java.util.Set<java.lang.String> qis)` Returns data quality according to various models.
`StatisticsQuality` `getQualityStatistics(java.util.Set<java.lang.String> qis)` Returns data quality according to various models.
`<T> java.util.Map<java.lang.String,StatisticsSummary<?>>` `getSummaryStatistics(boolean listwiseDeletion)` Returns summary statistics for all attributes.

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

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

### Constructor Detail

#### StatisticsBuilder

    public StatisticsBuilder(DataHandleInternal handle)

Creates a new instance.

Parameters:
  `handle` -

### Method Detail

#### getClassificationPerformance

    public StatisticsClassification getClassificationPerformance(java.lang.String clazz,
                                                                 ARXClassificationConfiguration<?> config)
                                                          throws java.text.ParseException

Creates a new set of statistics for the given classification task

Parameters:
  `clazz` - - The class attribute
  `config` - - The configuration
Throws:
  `java.text.ParseException`

#### getClassificationPerformance

    public StatisticsClassification getClassificationPerformance(java.lang.String[] features,
                                                                 java.lang.String clazz,
                                                                 ARXClassificationConfiguration<?> config)
                                                          throws java.text.ParseException

Creates a new set of statistics for the given classification task

Parameters:
  `features` - - The feature attributes
  `clazz` - - The class attributes
  `config` - - The configuration
Throws:
  `java.text.ParseException`

#### getClassificationPerformance

    public StatisticsClassification getClassificationPerformance(java.lang.String[] features,
                                                                 java.lang.String clazz,
                                                                 ARXClassificationConfiguration<?> config,
                                                                 ARXFeatureScaling scaling)
                                                          throws java.text.ParseException

Creates a new set of statistics for the given classification task

Parameters:
  `features` - - The feature attributes
  `clazz` - - The class attributes
  `config` - - The configuration
  `scaling` - - Feature scaling
Throws:
  `java.text.ParseException`

#### getContingencyTable

    public StatisticsContingencyTable getContingencyTable(int column1,
                                                          boolean orderFromDefinition1,
                                                          int column2,
                                                          boolean orderFromDefinition2)

Returns a contingency table for the given columns.

Parameters:
  `column1` - The first column
  `orderFromDefinition1` - Indicates whether the order that should be assumed for string data items can (and should) be derived from the hierarchy provided in the data definition (if any)
  `column2` - The second column
  `orderFromDefinition2` - Indicates whether the order that should be assumed for string data items can (and should) be derived from the hierarchy provided in the data definition (if any)
Returns:

#### getContingencyTable

    public StatisticsContingencyTable getContingencyTable(int column1,
                                                          int column2)

Returns a contingency table for the given columns. This method assumes that the order of string data items will be derived from the hierarchies provided in the data definition (if any)

Parameters:
  `column1` - The first column
  `column2` - The second column
Returns:

#### getContingencyTable

    public StatisticsContingencyTable getContingencyTable(int column1,
                                                          int size1,
                                                          boolean orderFromDefinition1,
                                                          int column2,
                                                          int size2,
                                                          boolean orderFromDefinition2)

Returns a contingency table for the given columns.

Parameters:
  `column1` - The first column
  `size1` - The maximal size in this dimension
  `orderFromDefinition1` - Indicates whether the order that should be assumed for string data items can (and should) be derived from the hierarchy provided in the data definition (if any)
  `column2` - The second column
  `size2` - The maximal size in this dimension
  `orderFromDefinition2` - Indicates whether the order that should be assumed for string data items can (and should) be derived from the hierarchy provided in the data definition (if any)
Returns:

#### getContingencyTable

    public StatisticsContingencyTable getContingencyTable(int column1,
                                                          int size1,
                                                          int column2,
                                                          int size2)

Returns a contingency table for the given columns. This method assumes that the order of string data items can (and should) be derived from the hierarchies provided in the data definition (if any)

Parameters:
  `column1` - The first column
  `size1` - The maximal size in this dimension
  `column2` - The second column
  `size2` - The maximal size in this dimension
Returns:

#### getContingencyTable

    public StatisticsContingencyTable getContingencyTable(int column1,
                                                          int size1,
                                                          java.lang.String[][] hierarchy1,
                                                          int column2,
                                                          int size2,
                                                          java.lang.String[][] hierarchy2)

Returns a contingency table for the given columns. The order for string data items is derived from the provided hierarchies

Parameters:
  `column1` - The first column
  `size1` - The maximal size in this dimension
  `hierarchy1` - The hierarchy for the first column, may be null
  `column2` - The second column
  `size2` - The maximal size in this dimension
  `hierarchy2` - The hierarchy for the second column, may be null
Returns:

#### getContingencyTable

    public StatisticsContingencyTable getContingencyTable(int column1,
                                                          java.lang.String[][] hierarchy1,
                                                          int column2,
                                                          java.lang.String[][] hierarchy2)

Returns a contingency table for the given columns. The order for string data items is derived from the provided hierarchies

Parameters:
  `column1` - The first column
  `hierarchy1` - The hierarchy for the first column, may be null
  `column2` - The second column
  `hierarchy2` - The hierarchy for the second column, may be null
Returns:

#### getDistinctValues

    public java.lang.String[] getDistinctValues(int column)

Returns the distinct set of data items from the given column.

Parameters:
  `column` - The column
Returns:

#### getDistinctValuesOrdered

    public java.lang.String[] getDistinctValuesOrdered(int column)

Returns an ordered list of the distinct set of data items from the given column. This method assumes that the order of string data items can (and should) be derived from the hierarchy provided in the data definition (if any)

Parameters:
  `column` - The column
Returns:

#### getDistinctValuesOrdered

    public java.lang.String[] getDistinctValuesOrdered(int column,
                                                       boolean orderFromDefinition)

Returns an ordered list of the distinct set of data items from the given column.

Parameters:
  `column` - The column
  `orderFromDefinition` - Indicates whether the order that should be assumed for string data items can (and should) be derived from the hierarchy provided in the data definition (if any)
Returns:

#### getDistinctValuesOrdered

    public java.lang.String[] getDistinctValuesOrdered(int column,
                                                       java.lang.String[][] hierarchy)

Returns an ordered list of the distinct set of data items from the given column. This method assumes that the order of string data items can (and should) be derived from the provided hierarchy

Parameters:
  `column` - The column
  `hierarchy` - The hierarchy, may be null
Returns:

#### getEquivalenceClassStatistics

    public StatisticsEquivalenceClasses getEquivalenceClassStatistics()

Returns statistics about the equivalence classes.

Returns:

#### getFrequencyDistribution

    public StatisticsFrequencyDistribution getFrequencyDistribution(int column)

Returns a frequency distribution for the values in the given column. This method assumes that the order of string data items can (and should) be derived from the hierarchy provided in the data definition (if any)

Parameters:
  `column` - The column
Returns:

#### getFrequencyDistribution

    public StatisticsFrequencyDistribution getFrequencyDistribution(int column,
                                                                    boolean orderFromDefinition)

Returns a frequency distribution for the values in the given column.

Parameters:
  `column` - The column
  `orderFromDefinition` - Indicates whether the order that should be assumed for string data items should be derived from the hierarchy provided in the data definition (if any)
Returns:

#### getFrequencyDistribution

    public StatisticsFrequencyDistribution getFrequencyDistribution(int column,
                                                                    java.lang.String[][] hierarchy)

Returns a frequency distribution for the values in the given column. The order for string data items is derived from the provided hierarchy

Parameters:
  `column` - The column
  `hierarchy` - The hierarchy, may be null
Returns:

#### getInterruptibleInstance

    public StatisticsBuilderInterruptible getInterruptibleInstance()

Returns an interruptible instance of this object.

Returns:

#### getQualityStatistics

    public StatisticsQuality getQualityStatistics()

Returns data quality according to various models.

Returns:

#### getQualityStatistics

    public StatisticsQuality getQualityStatistics(DataHandle output)

Returns data quality according to various models. This is a special variant of the method supporting arbitrary user-defined outputs.

Parameters:
  `output` -
Returns:

#### getQualityStatistics

    public StatisticsQuality getQualityStatistics(DataHandle output,
                                                  java.util.Set<java.lang.String> qis)

Returns data quality according to various models. This is a special variant of the method supporting arbitrary user-defined outputs.

Parameters:
  `output` -
  `qis` -
Returns:

#### getQualityStatistics

    public StatisticsQuality getQualityStatistics(java.util.Set<java.lang.String> qis)

Returns data quality according to various models.

Parameters:
  `qis` -
Returns:

#### getSummaryStatistics

    public <T> java.util.Map<java.lang.String,StatisticsSummary<?>> getSummaryStatistics(boolean listwiseDeletion)

Returns summary statistics for all attributes.

Parameters:
  `listwiseDeletion` - A flag enabling list-wise deletion
Returns: