本文整理汇总了Java中org.deidentifier.arx.DataHandle.getRiskEstimator方法的典型用法代码示例。如果您正苦于以下问题:Java DataHandle.getRiskEstimator方法的具体用法?Java DataHandle.getRiskEstimator怎么用?Java DataHandle.getRiskEstimator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.deidentifier.arx.DataHandle
的用法示例。
在下文中一共展示了DataHandle.getRiskEstimator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: analyzeData
import org.deidentifier.arx.DataHandle; //导入方法依赖的package包/类
/**
* Perform risk analysis
* @param handle
*/
private static void analyzeData(DataHandle handle) {
double THRESHOLD = 0.5d;
ARXPopulationModel populationmodel = ARXPopulationModel.create(Region.USA);
RiskEstimateBuilder builder = handle.getRiskEstimator(populationmodel);
RiskModelSampleSummary risks = builder.getSampleBasedRiskSummary(THRESHOLD);
System.out.println(" * Baseline risk threshold: " + getPrecent(THRESHOLD));
System.out.println(" * Prosecutor attacker model");
System.out.println(" - Records at risk: " + getPrecent(risks.getProsecutorRisk().getRecordsAtRisk()));
System.out.println(" - Highest risk: " + getPrecent(risks.getProsecutorRisk().getHighestRisk()));
System.out.println(" - Success rate: " + getPrecent(risks.getProsecutorRisk().getSuccessRate()));
System.out.println(" * Journalist attacker model");
System.out.println(" - Records at risk: " + getPrecent(risks.getJournalistRisk().getRecordsAtRisk()));
System.out.println(" - Highest risk: " + getPrecent(risks.getJournalistRisk().getHighestRisk()));
System.out.println(" - Success rate: " + getPrecent(risks.getJournalistRisk().getSuccessRate()));
System.out.println(" * Marketer attacker model");
System.out.println(" - Success rate: " + getPrecent(risks.getMarketerRisk().getSuccessRate()));
}
示例2: analyzeAttributes
import org.deidentifier.arx.DataHandle; //导入方法依赖的package包/类
/**
* Perform risk analysis
* @param handle
*/
private static void analyzeAttributes(DataHandle handle) {
ARXPopulationModel populationmodel = ARXPopulationModel.create(Region.USA);
RiskEstimateBuilder builder = handle.getRiskEstimator(populationmodel);
RiskModelAttributes riskmodel = builder.getAttributeRisks();
for (QuasiIdentifierRisk risk : riskmodel.getAttributeRisks()) {
System.out.println(" * Distinction: " + risk.getDistinction() + ", Separation: " + risk.getSeparation() + ", Identifier: " + risk.getIdentifier());
}
}
示例3: analyzeData
import org.deidentifier.arx.DataHandle; //导入方法依赖的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));
}
示例4: analyzeAttributes
import org.deidentifier.arx.DataHandle; //导入方法依赖的package包/类
/**
* Calculate Alpha Distinction and Separation
*
* @param handle the data handle
*/
private static void analyzeAttributes(DataHandle handle) {
ARXPopulationModel populationmodel = ARXPopulationModel.create(ARXPopulationModel.Region.USA);
RiskEstimateBuilder builder = handle.getRiskEstimator(populationmodel);
RiskModelAttributes riskmodel = builder.getAttributeRisks();
// output
printPrettyTable(riskmodel.getAttributeRisks());
}