当前位置: 首页>>代码示例>>Java>>正文


Java PopulationUniquenessModel类代码示例

本文整理汇总了Java中org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel的典型用法代码示例。如果您正苦于以下问题:Java PopulationUniquenessModel类的具体用法?Java PopulationUniquenessModel怎么用?Java PopulationUniquenessModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PopulationUniquenessModel类属于org.deidentifier.arx.risk.RiskModelPopulationUniqueness包,在下文中一共展示了PopulationUniquenessModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: analyze

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
private static void analyze(Data data, double risk, double population) throws IOException {

        ARXConfiguration config = ARXConfiguration.create();
        config.setMetric(Metric.createPrecomputedLossMetric(1.0d, 0.5d, AggregateFunction.GEOMETRIC_MEAN));
        config.setMaxOutliers(1d);
        config.addCriterion(new PopulationUniqueness(risk,
                                                     PopulationUniquenessModel.PITMAN,
                                                     new ARXPopulationModel(data.getHandle(), population), 
                                                     ARXSolverConfiguration.create().preparedStartValues(SOLVER_START_VALUES)
                                                     .iterationsPerTry(15)));
        
        ARXAnonymizer anonymizer = new ARXAnonymizer();
        ARXResult result = anonymizer.anonymize(data, config);
        double utility = 1d - Double.valueOf(result.getGlobalOptimum().getMaximumInformationLoss().toString());
        data.getHandle().release();
        System.out.print(risk * 100d);
        System.out.print(";");
        System.out.println(utility * 100d);
    }
 
开发者ID:arx-deidentifier,项目名称:risk-benchmark,代码行数:20,代码来源:BenchmarkExperimentHoshino.java

示例2: isFulfilled

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * 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
 * 
 * @param distribution
 * @return
 */
protected boolean isFulfilled(HashGroupifyDistribution distribution) {

    RiskModelPopulationUniqueness riskModel = new RiskModelPopulationUniqueness(this.populationModel,
                                                                                distribution.getHistogram(),
                                                                                solverConfig);
    
    double populationUniques = 0d;
    if (this.statisticalModel == PopulationUniquenessModel.DANKAR) {
        populationUniques = riskModel.getFractionOfUniqueTuplesDankar(false);
    } else {
        populationUniques = riskModel.getFractionOfUniqueTuples(this.statisticalModel);
    }
    if (populationUniques > 0d && populationUniques <= getRiskThreshold()) {
        return true;
    } else if (populationUniques == 0d && distribution.getFractionOfRecordsInClassesOfSize(1) == 0d) {
        return true;
    } else {
        return false;
    }
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:29,代码来源:PopulationUniqueness.java

示例3: getCriterion

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
@Override
public PrivacyCriterion getCriterion(Model model) {
       switch (variant) {
       case VARIANT_AVERAGE_RISK:
           return new AverageReidentificationRisk(threshold);
       case VARIANT_POPULATION_UNIQUES_DANKAR:
           return getPopulationBasedCriterion(PopulationUniquenessModel.DANKAR, model);
       case VARIANT_POPULATION_UNIQUES_PITMAN:
           return getPopulationBasedCriterion(PopulationUniquenessModel.PITMAN, model);
       case VARIANT_POPULATION_UNIQUES_SNB:
           return getPopulationBasedCriterion(PopulationUniquenessModel.SNB, model);
       case VARIANT_POPULATION_UNIQUES_ZAYATZ:
           return getPopulationBasedCriterion(PopulationUniquenessModel.ZAYATZ, model);
       case VARIANT_SAMPLE_UNIQUES:
           return new SampleUniqueness(threshold);
       default:
           throw new RuntimeException(Resources.getMessage("Model.0b")); //$NON-NLS-1$
       }
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:20,代码来源:ModelRiskBasedCriterion.java

示例4: getPopulationUniquessModel

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Gets the PopulationUniqueness Model out of the Index
 * @param x The Index
 * @return The Population Uniqueness Model
 */
private PopulationUniquenessModel getPopulationUniquessModel(int x) {
	switch (x) {
	case 0:
		return PopulationUniquenessModel.DANKAR;
	case 1:
		return PopulationUniquenessModel.PITMAN;
	case 2:
		return PopulationUniquenessModel.ZAYATZ;
	default:
		return PopulationUniquenessModel.SNB;
	}
}
 
开发者ID:WiednerF,项目名称:ARXPlugin,代码行数:18,代码来源:ARXPluginProcess.java

示例5: analyzeData

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Perform risk analysis
 * @param handle
 */
private static void analyzeData(DataHandle handle) {
    
    ARXPopulationModel populationmodel = ARXPopulationModel.create(Region.USA);
    RiskEstimateBuilder builder = handle.getRiskEstimator(populationmodel);
    RiskModelHistogram classes = builder.getEquivalenceClassModel();
    RiskModelSampleRisks sampleReidentifiationRisk = builder.getSampleBasedReidentificationRisk();
    RiskModelSampleUniqueness sampleUniqueness = builder.getSampleBasedUniquenessRisk();
    RiskModelPopulationUniqueness populationUniqueness = builder.getPopulationBasedUniquenessRisk();
    
    int[] histogram = classes.getHistogram();
    
    System.out.println("   * Equivalence classes:");
    System.out.println("     - Average size: " + classes.getAvgClassSize());
    System.out.println("     - Num classes : " + classes.getNumClasses());
    System.out.println("     - Histogram   :");
    for (int i = 0; i < histogram.length; i += 2) {
        System.out.println("        [Size: " + histogram[i] + ", count: " + histogram[i + 1] + "]");
    }
    System.out.println("   * Risk estimates:");
    System.out.println("     - Sample-based measures");
    System.out.println("       + Average risk     : " + sampleReidentifiationRisk.getAverageRisk());
    System.out.println("       + Lowest risk      : " + sampleReidentifiationRisk.getLowestRisk());
    System.out.println("       + Tuples affected  : " + sampleReidentifiationRisk.getFractionOfTuplesAffectedByLowestRisk());
    System.out.println("       + Highest risk     : " + sampleReidentifiationRisk.getHighestRisk());
    System.out.println("       + Tuples affected  : " + sampleReidentifiationRisk.getFractionOfTuplesAffectedByHighestRisk());
    System.out.println("       + Sample uniqueness: " + sampleUniqueness.getFractionOfUniqueTuples());
    System.out.println("     - Population-based measures");
    System.out.println("       + Population unqiueness (Zayatz): " + populationUniqueness.getFractionOfUniqueTuples(PopulationUniquenessModel.ZAYATZ));
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:34,代码来源:Example29.java

示例6: getPopulationBasedCriterion

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Returns a population-based criterion for the given models
 * @param statisticalModel
 * @param model
 * @return
 */
private PrivacyCriterion getPopulationBasedCriterion(PopulationUniquenessModel statisticalModel, Model model) {
    ModelRisk riskModel = model.getRiskModel();
    return new PopulationUniqueness(threshold, 
                                                   statisticalModel, 
                                                   riskModel.getPopulationModel().clone(),
                                                   riskModel.getSolverConfiguration());
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:14,代码来源:ModelRiskBasedCriterion.java

示例7: testDecisionRule2

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Test decision rule using the adult dataset.
 *
 * @throws IOException Signals that an I/O exception has occurred.
 */
@Test
public void testDecisionRule2() throws IOException {
    
    Data data = getDataObject("./data/adult.csv");
    DataHandle handle = data.getHandle();
    
    RiskModelPopulationUniqueness model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.1d)).getPopulationBasedUniquenessRisk();
    double sampleUniqueness = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.1d)).getSampleBasedUniquenessRisk().getFractionOfUniqueTuples();
    double populationUniqueness = model.getFractionOfUniqueTuplesDankar();
    
    if (model.getPopulationUniquenessModel() == PopulationUniquenessModel.PITMAN) {
        assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.27684993883653597) == 0);
    } else if (model.getPopulationUniquenessModel() == PopulationUniquenessModel.ZAYATZ) {
        assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.3207402393466189) == 0);
    } else {
        fail("Unexpected convergence of SNB");
    }
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) <= 0);
    
    model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.2d)).getPopulationBasedUniquenessRisk();
    populationUniqueness = model.getFractionOfUniqueTuplesDankar();
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.3577099234829125d) == 0);
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) <= 0);
    
    model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.01d)).getPopulationBasedUniquenessRisk();
    populationUniqueness = model.getFractionOfUniqueTuplesDankar();
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.1446083531167384) == 0);
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) <= 0);
    
    model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 1d)).getPopulationBasedUniquenessRisk();
    populationUniqueness = model.getFractionOfUniqueTuplesDankar();
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.5142895033485844) == 0);
    assertTrue(populationUniqueness + "/" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) == 0);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:40,代码来源:TestRiskMetrics.java

示例8: cases

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Returns the test cases.
 *
 * @return
 */
@Parameters(name = "{index}:[{0}]")
public static Collection<Object[]> cases() {
    return Arrays.asList(new Object[][] {
                                          /* 0 */{ new ARXAnonymizationTestCase(ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d)).addPrivacyModel(new AverageReidentificationRisk(0.01d)), "./data/adult.csv", 314637.8461904862, new int[] { 1, 0, 1, 1, 3, 2, 2, 1, 1 }, false) },
                                          { new ARXAnonymizationTestCase(ARXConfiguration.create(0.04d, Metric.createPrecomputedLossMetric(0.1d)).addPrivacyModel(new SampleUniqueness(0.01d)), "./data/adult.csv", 0.1606952725863784, new int[] { 0, 3, 0, 0, 1, 1, 1, 1, 0 }, false) },
                                          { new ARXAnonymizationTestCase(ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d)).addPrivacyModel(getPopulationUniqueness(0.0001d, PopulationUniquenessModel.DANKAR)), "./data/adult.csv", 144298.1603344462, new int[] { 0, 0, 1, 1, 1, 2, 1, 0, 0 }, false) },
                                          { new ARXAnonymizationTestCase(ARXConfiguration.create(0.04d, Metric.createPrecomputedLossMetric(0.1d)).addPrivacyModel(getPopulationUniqueness(0.0001d, PopulationUniquenessModel.ZAYATZ)), "./data/adult.csv", 0.16078200456326086, new int[] { 0, 3, 0, 0, 1, 1, 1, 1, 0 }, false) },
                                          { new ARXAnonymizationTestCase(ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d)).addPrivacyModel(getPopulationUniqueness(0.0001d, PopulationUniquenessModel.PITMAN)), "./data/adult.csv", 144298.1603344462, new int[] { 0, 0, 1, 1, 1, 2, 1, 0, 0 }, false) },
                                          { new ARXAnonymizationTestCase(ARXConfiguration.create(0.04d, Metric.createPrecomputedLossMetric(0.1d)).addPrivacyModel(getPopulationUniqueness(0.0001d, PopulationUniquenessModel.SNB)), "./data/adult.csv", 0.17599055898432758, new int[] { 0, 3, 0, 0, 2, 1, 1, 1, 0 }, false) }
    });
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:17,代码来源:TestAnonymizationRiskBased.java

示例9: getPopulationUniqueness

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Returns a privacy model for population uniquqeness
 * @param threshold
 * @param model
 * @return
 */
private static PopulationUniqueness getPopulationUniqueness(double threshold, PopulationUniquenessModel model) {
    
    return new PopulationUniqueness(threshold, model,
                                                 ARXPopulationModel.create(Region.USA),
                                                 ARXSolverConfiguration.create()
                                                                       .setDeterministic(true)
                                                                       .iterationsPerTry(15));
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:15,代码来源:TestAnonymizationRiskBased.java

示例10: update

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Updates this View for the new Attribute Risks
 * @param attributeRisk The Attribute Risk from Outside
 */
public void update(final String attributeRisk){
	
				final RiskEstimateBuilder builder;
				builder = result.getRiskEstimator(population);
				if (builder != null) {

					RiskModelAttributes      risks;
					switch (attributeRisk) {
		            case "SAMPLE_UNIQUENESS":
		                risks = builder.getSampleBasedAttributeRisks();
		                break;
		            case "POPULATION_UNIQUENESS_PITMAN":
		                risks = builder.getPopulationBasedAttributeRisks(PopulationUniquenessModel.PITMAN);
		                break;
		            case "POPULATION_UNIQUENESS_ZAYATZ":
		                risks = builder.getPopulationBasedAttributeRisks(PopulationUniquenessModel.ZAYATZ);
		                break;
		            case "POPULATION_UNIQUENESS_SNB":
		                risks = builder.getPopulationBasedAttributeRisks(PopulationUniquenessModel.SNB);
		                break;
		            case "POPULATION_UNIQUENESS_DANKAR":
		                risks = builder.getPopulationBasedAttributeRisks(PopulationUniquenessModel.DANKAR);
		                break;
		            default:
		                throw new RuntimeException("Invalid risk model"); //$NON-NLS-1$
		            }
					for (final TableItem i : table.getItems()) {
			            i.dispose();
			        }

	                // For all sizes
	                for (QuasiIdentifierRisk item : risks.getAttributeRisks()) {
	                    createItem(item);
	                }

	                for (final TableColumn col : table.getColumns()) {
	                    col.pack();
	                }

	                table.layout();
	                table.redraw();
					root.layout();
				}				
}
 
开发者ID:WiednerF,项目名称:ARXPlugin,代码行数:49,代码来源:ViewRisksQuasiIdentifierTable.java

示例11: build

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Builds the View of this Class
 * 
 * @param parent
 *            The Parent Composite
 */
private void build(final Composite parent) {
	this.root = new Composite(parent, SWT.NONE);
	this.root.setLayout(SWTUtil.createGridLayout(1));
	this.root.setLayoutData(SWTUtil.createFillGridDataBoth());

	table = SWTUtil.createTableDynamic(root, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	table.setMenu(new ClipboardHandlerTable(table).getMenu());
	table.setLayoutData(SWTUtil.createFillGridData());

	DynamicTableColumn c = new DynamicTableColumn(table, SWT.LEFT);
	c.setWidth("50%", "100px"); //$NON-NLS-1$ //$NON-NLS-2$
	c.setText(Resources.getMessage("RiskAnalysis.6")); //$NON-NLS-1$
	c = new DynamicTableColumn(table, SWT.LEFT);
	SWTUtil.createColumnWithBarCharts(table, c);
	c.setWidth("50%", "100px"); //$NON-NLS-1$ //$NON-NLS-2$
	c.setText(Resources.getMessage("RiskAnalysis.7")); //$NON-NLS-1$
	for (final TableColumn col : table.getColumns()) {
		col.pack();
	}
	SWTUtil.createGenericTooltip(table);
	// Enable/disable
	final RiskEstimateBuilder builder;
	builder = result.getRiskEstimator(population);
	if (builder != null) {

		double lowestRisk;
		double fractionOfTuplesAffectedByLowestRisk;
		double averageRisk;
		double highestRisk;
		double fractionOfTuplesAffectedByHighestRisk;
		double fractionOfUniqueTuples;
		double fractionOfUniqueTuplesDankar;
		PopulationUniquenessModel populationModel;

		// Perform work
		RiskModelSampleRisks samReidModel = builder.getSampleBasedReidentificationRisk();
		RiskModelSampleUniqueness samUniqueModel = builder.getSampleBasedUniquenessRisk();
		RiskModelPopulationUniqueness popUniqueModel = builder.getPopulationBasedUniquenessRisk();

		lowestRisk = samReidModel.getLowestRisk();
		fractionOfTuplesAffectedByLowestRisk = samReidModel.getFractionOfTuplesAffectedByLowestRisk();
		averageRisk = samReidModel.getAverageRisk();
		highestRisk = samReidModel.getHighestRisk();
		fractionOfTuplesAffectedByHighestRisk = samReidModel.getFractionOfTuplesAffectedByHighestRisk();
		fractionOfUniqueTuples = samUniqueModel.getFractionOfUniqueTuples();
		fractionOfUniqueTuplesDankar = popUniqueModel.getFractionOfUniqueTuplesDankar();
		populationModel = popUniqueModel.getPopulationUniquenessModel();

		table.setRedraw(false);
		for (final TableItem i : table.getItems()) {
			i.dispose();
		}

		createItem(Resources.getMessage("RiskAnalysis.14"), lowestRisk); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.17"), fractionOfTuplesAffectedByLowestRisk); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.8"), averageRisk); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.9"), highestRisk); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.10"), fractionOfTuplesAffectedByHighestRisk); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.11"), fractionOfUniqueTuples); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.12"), fractionOfUniqueTuplesDankar); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.18"), populationModel); //$NON-NLS-1$
		createItem(Resources.getMessage("RiskAnalysis.25"), getQuasiIdentifiers()); //$NON-NLS-1$

		table.setRedraw(true);
		root.layout();
	}
}
 
开发者ID:WiednerF,项目名称:ARXPlugin,代码行数:76,代码来源:ViewRisksReidentificationRisksTable.java

示例12: analyze

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
private static void analyze(String dataset, int rows, int columns) throws IOException {
    
    Data data = getDataObject(dataset, rows, columns);
    
    // Uniqueness
    ARXConfiguration config = ARXConfiguration.create();
    config.setMetric(Metric.createPrecomputedLossMetric(1.0d, 0.5d, AggregateFunction.GEOMETRIC_MEAN));
    config.setMaxOutliers(1d);
    config.addCriterion(new PopulationUniqueness(0.01d,
                                                 PopulationUniquenessModel.PITMAN,
                                                 new ARXPopulationModel(data.getHandle(), POPULATION_USA), 
                                                 ARXSolverConfiguration.create().preparedStartValues(SOLVER_START_VALUES)
                                                 .iterationsPerTry(15)));
    
    ARXAnonymizer anonymizer = new ARXAnonymizer();

    // Warmup
    ARXResult result = anonymizer.anonymize(data, config);
    double utility = 1d - Double.valueOf(result.getGlobalOptimum().getMaximumInformationLoss().toString());
    data.getHandle().release();

    long time = System.currentTimeMillis();
    for (int i=0; i<REPETITIONS; i++) {
        anonymizer.anonymize(data, config);
        data.getHandle().release();
    }
    double timeUniqueness = (double)(System.currentTimeMillis() - time) / (double)REPETITIONS;
    double utilityUniqueness = utility;
    
    // Strict average
    config = ARXConfiguration.create();
    config.setMetric(Metric.createPrecomputedLossMetric(1.0d, 0.5d, AggregateFunction.GEOMETRIC_MEAN));
    config.setMaxOutliers(1d);
    config.addCriterion(new KAnonymity(3));
    config.addCriterion(new AverageReidentificationRisk(0.2d));

    // Warmup
    result = anonymizer.anonymize(data, config);
    utility = 1d - Double.valueOf(result.getGlobalOptimum().getMaximumInformationLoss().toString());
    data.getHandle().release();

    time = System.currentTimeMillis();
    for (int i=0; i<REPETITIONS; i++) {
        anonymizer.anonymize(data, config);
        data.getHandle().release();
    }
    double timeStrictAverage = (double)(System.currentTimeMillis() - time) / (double)REPETITIONS;
    double utilityStrictAverage = utility;
    
    // K-anonymity
    config = ARXConfiguration.create();
    config.setMetric(Metric.createPrecomputedLossMetric(1.0d, 0.5d, AggregateFunction.GEOMETRIC_MEAN));
    config.setMaxOutliers(1d);
    config.addCriterion(new KAnonymity(5));

    // Warmup
    result = anonymizer.anonymize(data, config);
    utility = 1d - Double.valueOf(result.getGlobalOptimum().getMaximumInformationLoss().toString());
    data.getHandle().release();

    time = System.currentTimeMillis();
    for (int i=0; i<REPETITIONS; i++) {
        anonymizer.anonymize(data, config);
        data.getHandle().release();
    }
    double timeAnonymity = (double)(System.currentTimeMillis() - time) / (double)REPETITIONS;
    double utilityAnonymity = utility;
    
    BENCHMARK.addValue(TIME_UNIQUENESS, timeUniqueness);
    BENCHMARK.addValue(TIME_STRICT_AVERAGE, timeStrictAverage);
    BENCHMARK.addValue(TIME_ANONYMITY, timeAnonymity);
    BENCHMARK.addValue(UTILITY_UNIQUENESS, utilityUniqueness);
    BENCHMARK.addValue(UTILITY_STRICT_AVERAGE, utilityStrictAverage);
    BENCHMARK.addValue(UTILITY_ANONYMITY, utilityAnonymity);
}
 
开发者ID:arx-deidentifier,项目名称:risk-benchmark,代码行数:76,代码来源:BenchmarkExperimentScalability.java

示例13: getConfiguration

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Returns a configuration for the ARX framework
 * @param dataset
 * @param criteria
 * @param uniqueness
 * @return
 * @throws IOException
 */
public static ARXConfiguration getConfiguration(BenchmarkDataset dataset, 
                                                BenchmarkUtilityMeasure utility, 
                                                BenchmarkPrivacyModel criterion, 
                                                double uniqueness) throws IOException {
    
    ARXConfiguration config = ARXConfiguration.create();
    switch (utility) {
    case ENTROPY:
        config.setMetric(Metric.createPrecomputedNormalizedEntropyMetric(1.0d, AggregateFunction.SUM));
        break;
    case LOSS:
        config.setMetric(Metric.createPrecomputedLossMetric(1.0d, AggregateFunction.GEOMETRIC_MEAN));
        break;
    default:
        throw new IllegalArgumentException("");
    }
    
    config.setMaxOutliers(1.0d);
    
    switch (criterion) {
    case UNIQUENESS_DANKAR:
        config.addCriterion(new PopulationUniqueness(uniqueness, 
                                                     PopulationUniquenessModel.DANKAR,
                                                     ARXPopulationModel.create(Region.USA),
                                                     ARXSolverConfiguration.create().preparedStartValues(SOLVER_START_VALUES).iterationsPerTry(15)));
        break;
    case UNIQUENESS_SNB:
        config.addCriterion(new PopulationUniqueness(uniqueness, 
                                                     PopulationUniquenessModel.SNB,
                                                     ARXPopulationModel.create(Region.USA),
                                                     ARXSolverConfiguration.create().preparedStartValues(SOLVER_START_VALUES).iterationsPerTry(15)));
        break;
    case UNIQUENESS_PITMAN:
        config.addCriterion(new PopulationUniqueness(uniqueness, 
                                                     PopulationUniquenessModel.PITMAN,
                                                     ARXPopulationModel.create(Region.USA),
                                                     ARXSolverConfiguration.create().preparedStartValues(SOLVER_START_VALUES).iterationsPerTry(15)));
        break;
    case UNIQUENESS_ZAYATZ:
        config.addCriterion(new PopulationUniqueness(uniqueness, 
                                                     PopulationUniquenessModel.ZAYATZ,
                                                     ARXPopulationModel.create(Region.USA),
                                                     ARXSolverConfiguration.create().preparedStartValues(SOLVER_START_VALUES).iterationsPerTry(15)));
        break;
    case UNIQUENESS_SAMPLE:
        config.addCriterion(new SampleUniqueness(uniqueness));
        break;
    case K_ANONYMITY:
        config.addCriterion(new KAnonymity(getK(uniqueness)));
        break;
    default:
        throw new RuntimeException("Invalid criterion");
    }
    return config;
}
 
开发者ID:arx-deidentifier,项目名称:risk-benchmark,代码行数:64,代码来源:BenchmarkSetup.java

示例14: getStatisticalModel

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * @return the statisticalModel
 */
public PopulationUniquenessModel getStatisticalModel() {
    return statisticalModel;
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:7,代码来源:PopulationUniqueness.java

示例15: createItem

import org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel; //导入依赖的package包/类
/**
 * Creates a table item
 * @param label
 * @param value
 */
private void createItem(String label, PopulationUniquenessModel value) {
    TableItem item = new TableItem(table, SWT.NONE);
    item.setText(0, label);
    item.setText(1, value == null ? "N/A" : value.toString()); //$NON-NLS-1$
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:11,代码来源:ViewRisksReIdentificationTable.java


注:本文中的org.deidentifier.arx.risk.RiskModelPopulationUniqueness.PopulationUniquenessModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。