# PopulationUniqueness (ARX Developer Documentation)

org.deidentifier.arx.criteria

## Class PopulationUniqueness

- java.lang.Object
- - org.deidentifier.arx.criteria.PrivacyCriterion
  - - org.deidentifier.arx.criteria.SampleBasedCriterion
    - - org.deidentifier.arx.criteria.RiskBasedCriterion
      - - org.deidentifier.arx.criteria.PopulationUniqueness

- All Implemented Interfaces:
    java.io.Serializable

      public class PopulationUniqueness
      extends RiskBasedCriterion

  This criterion ensures that the population uniqueness falls below a given threshold.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PopulationUniqueness(double riskThreshold, ARXPopulationModel populationModel)` Creates a new instance of this criterion.
    `PopulationUniqueness(double riskThreshold, ARXPopulationModel populationModel, ARXSolverConfiguration config)` Creates a new instance of this criterion.
    `PopulationUniqueness(double riskThreshold, RiskModelPopulationUniqueness.PopulationUniquenessModel statisticalModel, ARXPopulationModel populationModel)` Creates a new instance of this criterion.
    `PopulationUniqueness(double riskThreshold, RiskModelPopulationUniqueness.PopulationUniquenessModel statisticalModel, ARXPopulationModel populationModel, ARXSolverConfiguration config)` Creates a new instance of this criterion.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PopulationUniqueness` | `clone()` Clone
    `ARXPopulationModel` | `getPopulationModel()` Returns the associated population model, `null` if there is none.
    `double` | `getRiskThresholdMarketer()` Return marketer risk threshold, 1 if there is none
    `RiskModelPopulationUniqueness.PopulationUniquenessModel` | `getStatisticalModel()`
    `void` | `initialize(DataManager manager, ARXConfiguration config)` Override this to initialize the criterion.
    `protected boolean` | `isFulfilled(HashGroupifyDistribution distribution)` We currently assume that at any time, at least one statistical model converges.
    `boolean` | `isLocalRecodingSupported()` Returns whether the criterion supports local recoding.
    `ElementData` | `render()` Renders the privacy model
    `java.lang.String` | `toString()` Returns a string representation.

    - ### Methods inherited from class org.deidentifier.arx.criteria.RiskBasedCriterion

      `enforce, getRequirements, getRiskThreshold`

    - ### Methods inherited from class org.deidentifier.arx.criteria.SampleBasedCriterion

      `isAnonymous, isSampleBased`

    - ### Methods inherited from class org.deidentifier.arx.criteria.PrivacyCriterion

      `clone, getDataSubset, getMinimalClassSize, getRiskThresholdJournalist, getRiskThresholdProsecutor, getSubset, isMinimalClassSizeAvailable, isMonotonicWithGeneralization, isMonotonicWithSuppression, isSubsetAvailable`

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

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

- - ### Constructor Detail

    - #### PopulationUniqueness

          public PopulationUniqueness(double riskThreshold,
                              ARXPopulationModel populationModel)

      Creates a new instance of this criterion. Uses Dankar's method for estimating population uniqueness. This constructor will clone the population model, making further changes to it will not influence the results. The default accuracy is 10e-6 and the default maximal number of iterations is 1000.
      Parameters:
        `riskThreshold` -
        `populationModel` -

    - #### PopulationUniqueness

          public PopulationUniqueness(double riskThreshold,
                              ARXPopulationModel populationModel,
                              ARXSolverConfiguration config)

      Creates a new instance of this criterion. Uses Dankar's method for estimating population uniqueness. This constructor will clone the population model, making further changes to it will not influence the results.
      Parameters:
        `riskThreshold` -
        `populationModel` -
        `config` -

    - #### PopulationUniqueness

          public PopulationUniqueness(double riskThreshold,
                              RiskModelPopulationUniqueness.PopulationUniquenessModel statisticalModel,
                              ARXPopulationModel populationModel)

      Creates a new instance of this criterion. Uses the specified method for estimating population uniqueness. This constructor will clone the population model, making further changes to it will not influence the results.
      Parameters:
        `riskThreshold` -
        `statisticalModel` -
        `populationModel` -

    - #### PopulationUniqueness

          public PopulationUniqueness(double riskThreshold,
                              RiskModelPopulationUniqueness.PopulationUniquenessModel statisticalModel,
                              ARXPopulationModel populationModel,
                              ARXSolverConfiguration config)

      Creates a new instance of this criterion. Uses the specified method for estimating population uniqueness. This constructor will clone the population model, making further changes to it will not influence the results. The default accuracy is 10e-6 and the default maximal number of iterations is 1000.
      Parameters:
        `riskThreshold` -
        `statisticalModel` -
        `populationModel` -
        `config` -

  - ### Method Detail

    - #### clone

          public PopulationUniqueness clone()

      Description copied from class: `PrivacyCriterion`
      Clone
      Specified by:
        `clone` in class `PrivacyCriterion`

    - #### getPopulationModel

          public ARXPopulationModel getPopulationModel()

      Description copied from class: `PrivacyCriterion`
      Returns the associated population model, `null` if there is none.
      Overrides:
        `getPopulationModel` in class `PrivacyCriterion`
      Returns:
        the populationModel

    - #### getRiskThresholdMarketer

          public double getRiskThresholdMarketer()

      Return marketer risk threshold, 1 if there is none
      Overrides:
        `getRiskThresholdMarketer` in class `PrivacyCriterion`
      Returns:

    - #### getStatisticalModel

          public RiskModelPopulationUniqueness.PopulationUniquenessModel getStatisticalModel()

      Returns:
        the statisticalModel

    - #### initialize

          public void initialize(DataManager manager,
                        ARXConfiguration config)

      Description copied from class: `PrivacyCriterion`
      Override this to initialize the criterion.
      Overrides:
        `initialize` in class `PrivacyCriterion`
        `config` - TODO

    - #### isLocalRecodingSupported

          public boolean isLocalRecodingSupported()

      Description copied from class: `PrivacyCriterion`
      Returns whether the criterion supports local recoding.
      Specified by:
        `isLocalRecodingSupported` in class `PrivacyCriterion`
      Returns:

    - #### render

          public ElementData render()

      Description copied from class: `PrivacyCriterion`
      Renders the privacy model
      Specified by:
        `render` in class `PrivacyCriterion`
      Returns:

    - #### toString

          public java.lang.String toString()

      Description copied from class: `PrivacyCriterion`
      Returns a string representation.
      Specified by:
        `toString` in class `PrivacyCriterion`

    - #### isFulfilled

          protected boolean isFulfilled(HashGroupifyDistribution distribution)

      We currently assume that at any time, at least one statistical model converges. This might not be the case, and 0 may be returned instead. That's why we only accept estimates of 0, if the number of equivalence classes of size 1 in the sample is also zero
      Specified by:
        `isFulfilled` in class `RiskBasedCriterion`
      Parameters:
        `distribution` -
      Returns: