本文整理汇总了Java中org.deidentifier.arx.framework.data.DataManager类的典型用法代码示例。如果您正苦于以下问题:Java DataManager类的具体用法?Java DataManager怎么用?Java DataManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataManager类属于org.deidentifier.arx.framework.data包,在下文中一共展示了DataManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IncognitoNodeChecker
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
/**
* Instantiates a new node checker incognito.
*
* @param manager the manager
* @param metric the metric
* @param config the configuration
* @param historyMaxSize the history max size
* @param historyThreshold the history threshold
*/
public IncognitoNodeChecker(final DataManager manager,
final Metric<?> metric,
final ARXConfigurationInternal config,
final int historyMaxSize,
final double historyThreshold,
final double snapshotSizeSnapshot) {
// Init super-class
super(manager,
metric,
config,
historyMaxSize,
historyThreshold,
snapshotSizeSnapshot);
// Create a specialized transformer
transformer = new IncognitoTransformer(manager.getDataQI().getArray(),
manager.getHierarchies(),
manager.getDataQI().getHeader().length,
manager.getDataSE().getArray(),
config,
history.getDictionarySensValue(),
history.getDictionarySensFreq());
}
示例2: DataHandleOutput
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
/**
* Instantiates a new handle.
*
* @param result
* @param registry
* @param manager
* @param outputGeneralized
* @param outputMicroaggregated
* @param node
* @param definition
* @param config
*/
protected DataHandleOutput(final ARXResult result,
final DataRegistry registry,
final DataManager manager,
final Data outputGeneralized,
final Data outputMicroaggregated,
final ARXNode node,
final DataDefinition definition,
final ARXConfiguration config) {
// Initialize
initialize(result, registry, manager, outputGeneralized, outputMicroaggregated, node, definition, config);
// Obtain data types
this.dataTypes = getDataTypeArray();
}
示例3: initialize
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
public void initialize(DataManager manager, ARXConfiguration config) {
// Compute domain shares
this.config = config.getCostBenefitConfiguration();
// We reduce this model to k-map or k-anonymity:
// adversaryPayoff = adversaryGain * successProbability - adversaryCost
// To give the adversary no incentives to attack we need to ensure that the following holds:
// adversaryGain * successProbability < adversaryCost
// -> successProbability < adversaryCost / adversaryGain
// With successProbability = 1 / [size of (population) group of r], we have:
// -> 1 / [size of (population) group of r] < adversaryCost / adversaryGain
// -> [size of (population) group of r] > adversaryGain / adversaryCost
double threshold = this.config.getAdversaryGain() / this.config.getAdversaryCost();
if (this.config.getAdversaryGain() == 0) {
this.k = 1;
} else if (Double.isInfinite(threshold)) {
this.k = Integer.MAX_VALUE;
} else if ((threshold == Math.floor(threshold))) {
this.k = (int) threshold + 1;
} else {
this.k = (int)Math.ceil(threshold);
}
}
示例4: initialize
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
public void initialize(DataManager manager, ARXConfiguration config) {
// Compute domain shares
this.shares = manager.getDomainShares();
this.config = config.getCostBenefitConfiguration();
this.riskModel = new RiskModelCostBenefit(this.config);
// Prepare consideration of microaggregation
this.microaggregationFunctions = manager.getMicroaggregationFunctions();
this.microaggregationStartIndex = manager.getMicroaggregationStartIndex();
this.microaggregationDomainSizes = manager.getMicroaggregationDomainSizes();
// Calculate MaxIL
this.maxIL = MetricSDNMEntropyBasedInformationLoss.getMaximalEntropyBasedInformationLoss(this.shares, this.microaggregationDomainSizes);
}
示例5: ARXResult
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
/**
* Creates a new instance.
*
* @param anonymizer
* @param registry
* @param manager
* @param checker
* @param definition
* @param config
* @param lattice
* @param duration
* @param solutionSpace
*/
protected ARXResult(ARXAnonymizer anonymizer,
DataRegistry registry,
DataManager manager,
NodeChecker checker,
DataDefinition definition,
ARXConfiguration config,
ARXLattice lattice,
long duration,
SolutionSpace solutionSpace) {
this.anonymizer = anonymizer;
this.registry = registry;
this.manager = manager;
this.checker = checker;
this.definition = definition;
this.config = config;
this.lattice = lattice;
this.optimalNode = lattice.getOptimum();
this.duration = duration;
this.solutionSpace = solutionSpace;
}
示例6: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
super.initializeInternal(manager, definition, input, hierarchies, config);
minHeight = 0;
maxHeight = 0;
Set<String> genQis = definition.getQuasiIdentifiersWithGeneralization();
for (String genQi : genQis) {
minHeight += definition.getMinimumGeneralization(genQi);
maxHeight += definition.getMaximumGeneralization(genQi);
}
}
示例7: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
// Prepare super
super.initializeInternal(manager, definition, input, hierarchies, config);
// Compute cardinalities
RowSet subset = super.getSubset(config);
// Cardinalities
this.cardinalities = new Cardinalities(input, subset, hierarchies);
// Distinct values
this.values = new int[hierarchies.length][][];
for (int i=0; i<values.length; i++) {
values[i] = new int[hierarchies[i].getHeight()][];
for (int j=0; j<values[i].length; j++){
values[i][j] = hierarchies[i].getDistinctValues(j);
}
}
}
示例8: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
super.initializeInternal(manager, definition, input, hierarchies, config);
// Compute domain shares
this.shares = manager.getDomainShares();
this.config = config.getCostBenefitConfiguration();
this.modelRisk = new RiskModelCostBenefit(this.config);
this.maximalPayout = new QualityMetadata<Double>(MAXIMAL_PAYOUT, super.getNumRecords(config, input) * this.config.getPublisherBenefit());
// Calculate MaxIL
this.maxIL = MetricSDNMEntropyBasedInformationLoss.getMaximalEntropyBasedInformationLoss(this.shares, super.getMicroaggregationDomainSizes());
}
示例9: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
super.initializeInternal(manager, definition, input, hierarchies, config);
this.upper = super.getUpperBounds();
// Compute a reasonable min & max
double[] min = new double[hierarchies.length];
Arrays.fill(min, 0d);
double[] max = new double[hierarchies.length];
Arrays.fill(max, 1d);
super.setMax(max);
super.setMin(min);
}
示例10: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
// Prepare weights
super.initializeInternal(manager, definition, input, hierarchies, config);
// Compute domain shares
this.shares = manager.getDomainShares();
// Calculate MaxIL
this.maxIL = getMaximalEntropyBasedInformationLoss(this.shares, super.getMicroaggregationDomainSizes());
}
示例11: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] ahierarchies,
final ARXConfiguration config) {
this.precomputed = true;
double rows = input.getDataLength();
for (GeneralizationHierarchy hierarchy : ahierarchies) {
double share = (double)hierarchy.getDistinctValues()[0] / rows;
if (share > threshold) {
this.precomputed = false;
break;
}
}
if (precomputed) {
precomputedMetric.initializeInternal(manager, definition, input, ahierarchies, config);
} else {
defaultMetric.initializeInternal(manager, definition, input, ahierarchies, config);
}
}
开发者ID:arx-deidentifier,项目名称:arx,代码行数:24,代码来源:AbstractMetricMultiDimensionalPotentiallyPrecomputed.java
示例12: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
// Prepare weights
super.initializeInternal(manager, definition, input, hierarchies, config);
// Determine total number of tuples
this.tuples = (double)super.getNumRecords(config, input);
// Save domain shares
this.shares = manager.getDomainShares();
// Min and max
double[] min = new double[getDimensions()];
Arrays.fill(min, 0d);
double[] max = new double[getDimensions()];
Arrays.fill(max, 1d);
super.setMin(min);
super.setMax(max);
}
示例13: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
super.initializeInternal(manager, definition, input, hierarchies, config);
// Min and max
double[] min = new double[hierarchies.length];
double[] max = new double[min.length];
for (int i=0; i<hierarchies.length; i++){
String attribute = hierarchies[i].getName();
min[i] = definition.getMinimumGeneralization(attribute);
max[i] = definition.getMaximumGeneralization(attribute);
}
setMin(min);
setMax(max);
}
示例14: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
this.tuples = (double) getNumRecords(config, input);
// Handle microaggregation
this.microaggregationFunctions = manager.getMicroaggregationFunctions();
this.microaggregationStartIndex = manager.getMicroaggregationStartIndex();
this.microaggregationDomainSizes = manager.getMicroaggregationDomainSizes();
if (!config.isUtilityBasedMicroaggregation() || !isAbleToHandleMicroaggregation()) {
this.microaggregationFunctions = new DistributionAggregateFunction[0];
this.microaggregationDomainSizes = new int[0];
}
}
示例15: initializeInternal
import org.deidentifier.arx.framework.data.DataManager; //导入依赖的package包/类
@Override
protected void initializeInternal(final DataManager manager,
final DataDefinition definition,
final Data input,
final GeneralizationHierarchy[] hierarchies,
final ARXConfiguration config) {
super.initializeInternal(manager, definition, input, hierarchies, config);
// Prepare
double gFactor = super.getGeneralizationFactor();
double sFactor = super.getSuppressionFactor();
// Compute a reasonable minimum & maximum
double[] min = new double[hierarchies.length];
Arrays.fill(min, 0d);
double[] max = new double[hierarchies.length];
for (int i=0; i<max.length; i++) {
max[i] = (2d * input.getDataLength() * log2(input.getDataLength())) * Math.max(gFactor, sFactor);
}
super.setMax(max);
super.setMin(min);
}