Klasse ARXConfiguration

java.lang.Object
org.deidentifier.arx.ARXConfiguration
Alle implementierten Schnittstellen:
Serializable, Cloneable

public class ARXConfiguration extends Object implements Serializable, Cloneable
A generic configuration for the ARX anonymizer.
Siehe auch:
  • Felddetails

    • REQUIREMENT_COUNTER

      public static final int REQUIREMENT_COUNTER
      Do the criteria require a counter per equivalence class.
      Siehe auch:
    • REQUIREMENT_DISTRIBUTION

      public static final int REQUIREMENT_DISTRIBUTION
      Do the criteria require distributions of sensitive values in the equivalence classes.
      Siehe auch:
    • REQUIREMENT_SECONDARY_COUNTER

      public static final int REQUIREMENT_SECONDARY_COUNTER
      Do the criteria require a second counter.
      Siehe auch:
  • Methodendetails

    • create

      public static ARXConfiguration create()
      Creates a new configuration without tuple suppression.
      Gibt zurück:
    • create

      public static ARXConfiguration create(double suppressionLimit)
      Creates a new configuration that allows the given percentage of outliers and thus implements tuple suppression.
      Parameter:
      suppressionLimit -
      Gibt zurück:
    • create

      public static ARXConfiguration create(double suppressionLimit, Metric<?> metric)
      Creates a new configuration that allows the given percentage of outliers and thus implements tuple suppression. Defines the metric for measuring information loss.
      Parameter:
      suppressionLimit -
      metric -
      Gibt zurück:
    • create

      public static ARXConfiguration create(Metric<?> metric)
      Creates a new configuration that allows to define the metric for measuring information loss.
      Parameter:
      metric -
      Gibt zurück:
    • addPrivacyModel

      public ARXConfiguration addPrivacyModel(PrivacyCriterion c)
      Adds a privacy model to the configuration.
      Parameter:
      c -
      Gibt zurück:
    • clone

      public ARXConfiguration clone()
      Clones this config.
      Setzt außer Kraft:
      clone in Klasse Object
      Gibt zurück:
    • getAlgorithm

      Returns the anonymization algorithm selected
      Gibt zurück:
    • getAttributeWeight

      public double getAttributeWeight(String attribute)
      Returns the weight for the given attribute.
      Parameter:
      attribute -
      Gibt zurück:
    • getAttributeWeights

      public Map<String,Double> getAttributeWeights()
      Returns all configured attribute weights. For attributes which are not a key in this set the default attribute weight will be assumed by ARX. This default value is currently set to 0.5.
      Gibt zurück:
    • getCostBenefitConfiguration

      public ARXCostBenefitConfiguration getCostBenefitConfiguration()
      Returns the cost/benefit configuration
    • getDPSearchBudget

      public double getDPSearchBudget()
      Returns the privacy budget to use for the data-dependent differential privacy search algorithm. The default is 0.1.
      Gibt zurück:
    • getGeneticAlgorithmCrossoverFraction

      public double getGeneticAlgorithmCrossoverFraction()
      Returns the fraction of individuals crossed over
      Gibt zurück:
    • getGeneticAlgorithmDeterministic

      public boolean getGeneticAlgorithmDeterministic()
      Deterministic execution
      Gibt zurück:
    • getGeneticAlgorithmEliteFraction

      public double getGeneticAlgorithmEliteFraction()
      Returns the size of the elite group
      Gibt zurück:
    • getGeneticAlgorithmImmigrationFraction

      public double getGeneticAlgorithmImmigrationFraction()
      Returns the fraction to immigrate
      Gibt zurück:
    • getGeneticAlgorithmImmigrationInterval

      public int getGeneticAlgorithmImmigrationInterval()
      Returns the immigration interval
      Gibt zurück:
    • getGeneticAlgorithmIterations

      public int getGeneticAlgorithmIterations()
      Returns the genetic algorithm iterations
      Gibt zurück:
    • getGeneticAlgorithmMutationProbability

      public double getGeneticAlgorithmMutationProbability()
      Returns the mutation probability
      Gibt zurück:
    • getGeneticAlgorithmProductionFraction

      public double getGeneticAlgorithmProductionFraction()
      Returns the production fraction
      Gibt zurück:
    • getGeneticAlgorithmSubpopulationSize

      public int getGeneticAlgorithmSubpopulationSize()
      Returns the size of the sub-population
      Gibt zurück:
    • getHeuristicSearchStepLimit

      public int getHeuristicSearchStepLimit(ARXConfiguration.SearchStepSemantics requestedSearchStepSemantics, int numQIs)
      The heuristic search algorithm will terminate after the returned number of steps. The default is Integer.MAX_VALUE, i.e. no limit.
      Parameter:
      requestedSearchStepSemantics - the semantics of the number of search steps to be returned
      numQIs - the number of QIs
      Gibt zurück:
    • getHeuristicSearchThreshold

      public int getHeuristicSearchThreshold()
      When the size of the solution space exceeds the returned number of transformations, ARX will use a heuristic search strategy. The default is 100.000.
      Gibt zurück:
    • getHeuristicSearchTimeLimit

      public int getHeuristicSearchTimeLimit()
      The heuristic search algorithm will terminate after the returned number of milliseconds. The default is 30 seconds.
      Gibt zurück:
    • getMaxOutliers

      @Deprecated public double getMaxOutliers()
      Veraltet.
      Returns the maximum number of allowed outliers. Deprecated. Use getSuppressionLimit() instead.
      Gibt zurück:
    • getMonotonicityOfPrivacy

      public ARXConfiguration.Monotonicity getMonotonicityOfPrivacy()
      Returns whether the privacy model is monotonic
      Gibt zurück:
    • getMonotonicityOfUtility

      public ARXConfiguration.Monotonicity getMonotonicityOfUtility()
      Returns whether the utility measure is monotonic
      Gibt zurück:
    • getPrivacyModel

      public <T extends PrivacyCriterion> T getPrivacyModel(Class<T> clazz)
      Returns an instance of the class, if any. Throws an exception if more than one such model exists.
      Typparameter:
      T -
      Parameter:
      clazz -
      Gibt zurück:
    • getPrivacyModels

      public Set<PrivacyCriterion> getPrivacyModels()
      Returns all privacy models.
      Gibt zurück:
    • getPrivacyModels

      public <T extends PrivacyCriterion> Set<T> getPrivacyModels(Class<T> clazz)
      Returns all privacy models which are instances of the given class.
      Typparameter:
      T -
      Parameter:
      clazz -
      Gibt zurück:
    • getQualityModel

      public Metric<?> getQualityModel()
      Returns the quality model to be used for optimizing output data.
      Gibt zurück:
    • getRiskThresholdJournalist

      public double getRiskThresholdJournalist()
      Return journalist risk threshold, 1 if there is none
      Gibt zurück:
    • getRiskThresholdMarketer

      public double getRiskThresholdMarketer()
      Return marketer risk threshold, 1 if there is none
      Gibt zurück:
    • getRiskThresholdProsecutor

      public double getRiskThresholdProsecutor()
      Return prosecutor risk threshold, 1 if there is none
      Gibt zurück:
    • getSuppressionLimit

      public double getSuppressionLimit()
      Returns the suppression limit
      Gibt zurück:
    • isAttributeTypeSuppressed

      public boolean isAttributeTypeSuppressed(AttributeType type)
      Returns whether values of the given attribute type will be replaced by the suppression string in suppressed tuples.
      Parameter:
      type -
      Gibt zurück:
    • isPracticalMonotonicity

      public boolean isPracticalMonotonicity()
      Is practical monotonicity assumed.
      Gibt zurück:
    • isPrivacyModelSpecified

      public boolean isPrivacyModelSpecified(Class<? extends PrivacyCriterion> clazz)
      Returns whether the configuration contains a privacy model which is an instance of the given class.
      Parameter:
      clazz -
      Gibt zurück:
    • isSuppressionAlwaysEnabled

      public boolean isSuppressionAlwaysEnabled()
      Returns whether suppression is applied to the output of anonymous as well as non-anonymous transformations. If this flag is set to true, suppression will be applied to the output of non-anonymous transformations to make them anonymous (if possible). Default is true.
      Gibt zurück:
    • isUseHeuristicSearchForSampleBasedCriteria

      public boolean isUseHeuristicSearchForSampleBasedCriteria()
      Is optimality guaranteed for sample-based criteria?
    • removeCriterion

      public <T extends PrivacyCriterion> boolean removeCriterion(PrivacyCriterion arg)
      Removes the given criterion.
      Typparameter:
      T -
      Parameter:
      arg -
      Gibt zurück:
    • render

      public List<ElementData> render()
      Renders this object
      Gibt zurück:
    • setAlgorithm

      public void setAlgorithm(ARXConfiguration.AnonymizationAlgorithm algorithm)
      Sets the algorithm to use
      Parameter:
      algorithm -
    • setAttributeTypeSuppressed

      public void setAttributeTypeSuppressed(AttributeType type, boolean enabled)
      Defines values of which attribute type are to be replaced by the suppression string in suppressed tuples. With default settings, only quasi-identifiers will be suppressed.
      Parameter:
      type - the attribute type
      enabled - whether suppression should be performed or not
    • setAttributeWeight

      public void setAttributeWeight(String attribute, double weight)
      Sets the weight for the given attribute.
      Parameter:
      attribute -
      weight -
    • setAttributeWeight

      public void setAttributeWeight(String attribute, Double weight)
      Sets the weight for the given attribute.
      Parameter:
      attribute -
      weight -
    • setCostBenefitConfiguration

      public ARXConfiguration setCostBenefitConfiguration(ARXCostBenefitConfiguration config)
      Sets the cost/benefit configuration
      Parameter:
      config -
    • setDPSearchBudget

      public void setDPSearchBudget(double budget)
      Sets the privacy budget to use for the data-dependent differential privacy search algorithm. The default is 0.1.
      Parameter:
      budget -
    • setGeneticAlgorithmCrossoverFraction

      public void setGeneticAlgorithmCrossoverFraction(double geneticAlgorithmCrossoverFraction)
      Sets the fraction of individuals crossed over
      Parameter:
      geneticAlgorithmCrossoverPercent -
    • setGeneticAlgorithmDeterministic

      public void setGeneticAlgorithmDeterministic(boolean geneticAlgorithmDeterministic)
      Deterministic execution
      Parameter:
      geneticAlgorithmDeterministic -
    • setGeneticAlgorithmEliteFraction

      public void setGeneticAlgorithmEliteFraction(double geneticAlgorithmEliteFraction)
      Sets the size of the elite group
      Parameter:
      geneticAlgorithmElitePercent -
    • setGeneticAlgorithmImmigrationFraction

      public void setGeneticAlgorithmImmigrationFraction(double geneticAlgorithmImmigrationFraction)
      Sets the fraction to immigrate
      Parameter:
      geneticAlgorithmImmigrationFraction -
    • setGeneticAlgorithmImmigrationInterval

      public void setGeneticAlgorithmImmigrationInterval(int geneticAlgorithmImmigrationInterval)
      Sets the immigration interval
      Parameter:
      geneticAlgorithmImmigrationInterval -
    • setGeneticAlgorithmIterations

      public void setGeneticAlgorithmIterations(int geneticAlgorithmIterations)
      Sets the genetic algorithm iterations
      Parameter:
      geneticAlgorithmIterations -
    • setGeneticAlgorithmMutationProbability

      public void setGeneticAlgorithmMutationProbability(double geneticAlgorithmMutationProbability)
      Sets the mutation probability
      Parameter:
      geneticAlgorithmMutationProbability -
    • setGeneticAlgorithmProductionFraction

      public void setGeneticAlgorithmProductionFraction(double geneticAlgorithmProductionFraction)
      Sets the production fraction
      Parameter:
      geneticAlgorithmImmigrationInterval -
    • setGeneticAlgorithmSubpopulationSize

      public void setGeneticAlgorithmSubpopulationSize(int geneticAlgorithmSubpopulationSize)
      Setter
      Parameter:
      geneticAlgorithmSubpopulationSize -
    • setHeuristicSearchStepLimit

      public void setHeuristicSearchStepLimit(int numberOfTransformations)
      The heuristic search algorithm will terminate after the given number of transformations have been checked. The default is Integer.MAX_VALUE, i.e. no limit. ARX supports different search step semantics. The standards semantics (implemented by this method) is that this parameter restricts the number of transformations from the solution space that are searched during anonymization.
      Parameter:
      numberOfTransformations -
    • setHeuristicSearchStepLimit

      public void setHeuristicSearchStepLimit(int numberOfTransformations, ARXConfiguration.SearchStepSemantics searchStepSemantics)
      Sets the semantics of heuristic search steps. If the semantic EXPANSIONS is set, then the limit of the number of heuristic checks will be calculated by multiplying the heuristic search step limit with the number of QIs.
      Parameter:
      searchStepSemantics -
    • setHeuristicSearchThreshold

      public void setHeuristicSearchThreshold(int numberOfTransformations)
      When the size of the solution space exceeds the given number of transformations, ARX will use a heuristic search strategy. The default is 100.000.
      Parameter:
      numberOfTransformations -
    • setHeuristicSearchTimeLimit

      public void setHeuristicSearchTimeLimit(int timeInMillis)
      The heuristic search algorithm will terminate after the given number of milliseconds. The default is 30 seconds.
      Parameter:
      timeInMillis -
    • setMaxOutliers

      @Deprecated public void setMaxOutliers(double max)
      Veraltet.
      Allows for a certain percentage of outliers and thus triggers tuple suppression. Deprecated. Use setSuppressionLimit() instead.
      Parameter:
      max -
    • setPracticalMonotonicity

      public void setPracticalMonotonicity(boolean assumeMonotonicity)
      Set, if practical monotonicity assumed.
      Parameter:
      assumeMonotonicity -
    • setQualityModel

      public void setQualityModel(Metric<?> model)
      Sets the quality model to be used for optimizing output data.
      Parameter:
      model -
    • setSuppressionAlwaysEnabled

      public void setSuppressionAlwaysEnabled(boolean enabled)
      Sets whether suppression is applied to the output of anonymous as well as non-anonymous transformations. If this flag is set to true, suppression will be applied to the output of non-anonymous transformations to make them anonymous (if possible). Default is true.
      Parameter:
      enabled -
    • setSuppressionLimit

      public void setSuppressionLimit(double limit)
      Sets the suppression limit. This is an alias for setMaxOutliers().
      Parameter:
      limit -
    • setUseHeuristicSearchForSampleBasedCriteria

      public void setUseHeuristicSearchForSampleBasedCriteria(boolean value)
      Do we guarantee optimality for sample-based criteria?
    • getAbsoluteSuppressionLimit

      protected int getAbsoluteSuppressionLimit()
      Returns the absolute record suppression limit
      Gibt zurück:
    • getInstanceForLocalRecoding

      protected ARXConfiguration getInstanceForLocalRecoding(RowSet rowset, double gsFactor)
      Clones this config and projects everything onto the given subset.
      - All privacy models will be cloned
      - Subsets in d-presence will be projected accordingly
      - Utility measures will be cloned
      - Replaces estimated k-map with according k-anonymity
      Parameter:
      rowset -
      gsFactor - May be NaN if it should be ignored
      Gibt zurück:
    • getInternalConfiguration

      protected ARXConfiguration.ARXConfigurationInternal getInternalConfiguration()
      Returns an internal variant of the class which provides a broader interface
      Gibt zurück:
    • getMinimalGroupSize

      protected int getMinimalGroupSize()
      Returns the minimal size of an equivalence class induced by the defined privacy models.
      Gibt zurück:
      If k-anonymity is contained, k is returned. If l-diversity is contained, l is returned. If both are contained max(k,l) is returned. Otherwise, Integer.MAX_VALUE is returned.
    • getNumOutputRecords

      protected int getNumOutputRecords()
      Returns the number of output records that will be produced, zero if this information is not available
      Gibt zurück:
    • getPrivacyModelsAsArray

      protected PrivacyCriterion[] getPrivacyModelsAsArray()
      Returns all criteria (except k-anonymity) as an array. Only used internally. If k-anonymity is included the minimal group size should be obtained and enforced
      Gibt zurück:
    • getRequirements

      protected int getRequirements()
      Returns the criteria's requirements.
      Gibt zurück:
    • getSampleBasedPrivacyModelsAsArray

      protected SampleBasedCriterion[] getSampleBasedPrivacyModelsAsArray()
      Returns all sample-based criteria as an array. Only used internally.
      Gibt zurück:
    • getSnapshotLength

      protected int getSnapshotLength()
      Returns the specific length of each entry in a snapshot.
      Gibt zurück:
    • getSubset

      protected DataSubset getSubset()
      Returns the data subset, if any subset is defined. You may only call this, after the configuration has be initialized.
      Gibt zurück:
    • getSuppressedAttributeTypes

      protected int getSuppressedAttributeTypes()
      Returns an integer representing all attribute types that must be suppressed.
      Gibt zurück:
    • initialize

      protected void initialize(org.deidentifier.arx.framework.data.DataManager manager)
      Initializes the configuration.
      Parameter:
      manager -
    • requires

      protected boolean requires(int requirement)
      Convenience method for checking the requirements.
      Parameter:
      requirement -
      Gibt zurück: