# RiskBasedCriterion (ARX GUI Documentation)

org.deidentifier.arx.criteria

## Class RiskBasedCriterion

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

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    AverageReidentificationRisk, PopulationUniqueness, SampleUniqueness

      public abstract class RiskBasedCriterion
      extends SampleBasedCriterion

  Abstract class for criteria that ensure that a certain risk measure is lower than or equal to a given threshold
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RiskBasedCriterion(boolean monotonicWithSuppression, boolean monotonicWithGeneralization, double riskThreshold)` Creates a new instance of this criterion.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `enforce(org.deidentifier.arx.framework.check.groupify.HashGroupifyDistribution distribution, int numMaxSuppressedOutliers)` This method enforces the criterion on the current hash table.
    `int` | `getRequirements()` Returns the criterion's requirements.
    `double` | `getRiskThreshold()` Returns the risk threshold
    `protected abstract boolean` | `isFulfilled(org.deidentifier.arx.framework.check.groupify.HashGroupifyDistribution distribution)` To be implemented by risk-based criteria

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

      `isAnonymous, isSampleBased`

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

      `clone, clone, getDataSubset, getMinimalClassSize, getPopulationModel, getRiskThresholdJournalist, getRiskThresholdMarketer, getRiskThresholdProsecutor, getSubset, initialize, isLocalRecodingSupported, isMinimalClassSizeAvailable, isMonotonicWithGeneralization, isMonotonicWithSuppression, isSubsetAvailable, render, toString`

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

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

- - ### Constructor Detail

    - #### RiskBasedCriterion

          public RiskBasedCriterion(boolean monotonicWithSuppression,
                            boolean monotonicWithGeneralization,
                            double riskThreshold)

      Creates a new instance of this criterion.
      Parameters:
        `monotonicWithSuppression` -
        `monotonicWithGeneralization` -
        `riskThreshold` -

  - ### Method Detail

    - #### enforce

          public void enforce(org.deidentifier.arx.framework.check.groupify.HashGroupifyDistribution distribution,
                     int numMaxSuppressedOutliers)

      Description copied from class: `SampleBasedCriterion`
      This method enforces the criterion on the current hash table. Criteria can be enforced by suppressing classes in the distribution by passing a PrivacyCondition. Criteria may abort early, if the threshold is reached (`distribution.getNumOfSuppressedTuples() > numMaxSuppressedOutliers`).
      Specified by:
        `enforce` in class `SampleBasedCriterion`

    - #### getRequirements

          public int getRequirements()

      Description copied from class: `PrivacyCriterion`
      Returns the criterion's requirements.
      Specified by:
        `getRequirements` in class `PrivacyCriterion`
      Returns:

    - #### getRiskThreshold

          public double getRiskThreshold()

      Returns the risk threshold
      Returns:

    - #### isFulfilled

          protected abstract boolean isFulfilled(org.deidentifier.arx.framework.check.groupify.HashGroupifyDistribution distribution)

      To be implemented by risk-based criteria
      Parameters:
        `distribution` -
      Returns: