コード例 #1
0
 /**
  * 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, true))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/adult.csv",
               255559.85455731067,
               new int[] {1, 0, 1, 1, 3, 2, 2, 0, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/adult.csv",
               379417.3460570988,
               new int[] {1, 1, 1, 1, 3, 2, 2, 1, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/adult.csv",
               407289.5388925293,
               new int[] {1, 2, 1, 1, 3, 2, 2, 1, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/adult.csv",
               453196.8932458743,
               new int[] {0, 4, 1, 1, 3, 2, 2, 1, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/adult.csv",
               255559.85455731067,
               new int[] {1, 0, 1, 1, 3, 2, 2, 0, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/adult.csv",
               379417.3460570988,
               new int[] {1, 1, 1, 1, 3, 2, 2, 1, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/cup.csv",
               1764006.4033760305,
               new int[] {2, 4, 0, 1, 0, 4, 4, 4},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/cup.csv",
               1994002.8308631124,
               new int[] {3, 4, 1, 1, 0, 4, 4, 4},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/cup.csv",
               2445878.424834677,
               new int[] {4, 4, 1, 1, 1, 4, 4, 4},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/cup.csv",
               2517471.5816586106,
               new int[] {5, 4, 1, 0, 1, 4, 4, 4},
               false)
         },
         /* 10 */ {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/cup.csv",
               1764006.4033760305,
               new int[] {2, 4, 0, 1, 0, 4, 4, 4},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/cup.csv",
               2001343.4737485605,
               new int[] {3, 4, 1, 1, 0, 1, 2, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/fars.csv",
               4469271.0,
               new int[] {0, 2, 2, 2, 1, 2, 1, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/fars.csv",
               5.6052481E7,
               new int[] {0, 2, 3, 3, 1, 2, 2, 2},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/fars.csv",
               1.42377891E8,
               new int[] {1, 2, 3, 3, 1, 2, 1, 2},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/fars.csv",
               4.36925397E8,
               new int[] {5, 2, 3, 3, 1, 2, 0, 2},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new KAnonymity(5)),
               "./data/fars.csv",
               4469271.0,
               new int[] {0, 2, 2, 2, 1, 2, 1, 0},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new KAnonymity(100)),
               "./data/fars.csv",
               5.6052481E7,
               new int[] {0, 2, 3, 3, 1, 2, 2, 2},
               true)
         },
       });
 }
コード例 #2
0
 /**
  * Returns the test cases.
  *
  * @return
  * @throws IOException
  */
 @Parameters(name = "{index}:[{0}]")
 public static Collection<Object[]> cases() throws IOException {
   return Arrays.asList(
       new Object[][] {
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new KMap(
                           3,
                           0.01d,
                           ARXPopulationModel.create(Region.USA),
                           CellSizeEstimator.ZERO_TRUNCATED_POISSON)),
               "occupation",
               "./data/adult.csv",
               130804.5332092598,
               new int[] {0, 0, 1, 1, 0, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new KMap(
                           1000,
                           0.01d,
                           ARXPopulationModel.create(Region.USA),
                           CellSizeEstimator.ZERO_TRUNCATED_POISSON)),
               "occupation",
               "./data/adult.csv",
               151894.1394841501,
               new int[] {0, 0, 1, 1, 1, 2, 1, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createAECSMetric())
                   .addPrivacyModel(
                       new KMap(
                           5,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               45.014925373134325,
               new int[] {1, 0, 1, 2, 3, 2, 2, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new KMap(
                           3,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               23387.494246375998,
               new int[] {0, 0, 1, 2, 3, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new KMap(
                           5,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               28551.7222913157,
               new int[] {1, 0, 1, 2, 3, 2, 2, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createAECSMetric())
                   .addPrivacyModel(
                       new KMap(
                           20,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               11.424242424242424,
               new int[] {1, 0, 1, 1, 3, 2, 1, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new KMap(
                           7,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               17075.7181747451,
               new int[] {0, 0, 1, 1, 2, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new KMap(
                           3,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               15121.633326877098,
               new int[] {0, 0, 1, 1, 1, 2, 1, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createAECSMetric())
                   .addPrivacyModel(
                       new KMap(
                           5,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               45.014925373134325,
               new int[] {1, 0, 1, 2, 3, 2, 2, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new KMap(
                           2,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               23108.1673304724,
               new int[] {1, 0, 1, 1, 3, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new KMap(
                           10,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               30238.2081484441,
               new int[] {0, 1, 1, 2, 3, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createAECSMetric())
                   .addPrivacyModel(
                       new KMap(
                           10,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               7.215311004784689,
               new int[] {0, 0, 1, 1, 3, 2, 1, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new KMap(
                           5,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               17053.8743069776,
               new int[] {0, 0, 1, 0, 2, 2, 2, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new KMap(
                           3,
                           DataSubset.create(
                               Data.create("./data/adult.csv", StandardCharsets.UTF_8, ';'),
                               Data.create(
                                   "./data/adult_subset.csv", StandardCharsets.UTF_8, ';')))),
               "occupation",
               "./data/adult.csv",
               15121.633326877098,
               new int[] {0, 0, 1, 1, 1, 2, 1, 0},
               false)
         },
       });
 }
コード例 #3
0
 /**
  * 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, false))
                   .addPrivacyModel(
                       new EntropyLDiversity("occupation", 5, EntropyEstimator.GRASSBERGER)),
               "occupation",
               "./data/adult.csv",
               216092.124036387,
               new int[] {1, 0, 1, 0, 3, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new EntropyLDiversity("occupation", 100, EntropyEstimator.SHANNON)),
               "occupation",
               "./data/adult.csv",
               0.0d,
               null,
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new EntropyLDiversity("occupation", 5, EntropyEstimator.GRASSBERGER)),
               "occupation",
               "./data/adult.csv",
               324620.5269918692,
               new int[] {1, 1, 1, 1, 3, 2, 2, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.05d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new EntropyLDiversity("occupation", 3, EntropyEstimator.GRASSBERGER)),
               "occupation",
               "./data/adult.csv",
               180347.4325366015,
               new int[] {0, 0, 1, 1, 2, 2, 2, 0},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new EntropyLDiversity("occupation", 5, EntropyEstimator.SHANNON)),
               "occupation",
               "./data/adult.csv",
               228878.2039109517,
               new int[] {1, 0, 1, 1, 2, 2, 2, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.1d, Metric.createPrecomputedEntropyMetric(0.1d, false))
                   .addPrivacyModel(
                       new EntropyLDiversity("occupation", 100, EntropyEstimator.GRASSBERGER)),
               "occupation",
               "./data/adult.csv",
               0.0d,
               null,
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(
                       new EntropyLDiversity("RAMNTALL", 5, EntropyEstimator.GRASSBERGER)),
               "RAMNTALL",
               "./data/cup.csv",
               1833435.0,
               new int[] {4, 0, 1, 0, 1, 3, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.03d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(
                       new EntropyLDiversity("RAMNTALL", 100, EntropyEstimator.GRASSBERGER)),
               "RAMNTALL",
               "./data/cup.csv",
               4.5168281E7,
               new int[] {4, 4, 0, 0, 1, 3, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new EntropyLDiversity("RAMNTALL", 5)),
               "RAMNTALL",
               "./data/cup.csv",
               3.01506905E8,
               new int[] {4, 4, 1, 1, 1, 4, 4},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(new EntropyLDiversity("RAMNTALL", 3)),
               "RAMNTALL",
               "./data/cup.csv",
               9.2264547E7,
               new int[] {4, 4, 1, 0, 1, 4, 4},
               false)
         },
         /* 10 */ {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(
                       new EntropyLDiversity("RAMNTALL", 5, EntropyEstimator.SHANNON)),
               "RAMNTALL",
               "./data/cup.csv",
               2823649.0,
               new int[] {4, 0, 0, 1, 1, 3, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.1d, Metric.createDiscernabilityMetric(true))
                   .addPrivacyModel(
                       new EntropyLDiversity("RAMNTALL", 100, EntropyEstimator.GRASSBERGER)),
               "RAMNTALL",
               "./data/cup.csv",
               3.4459973E7,
               new int[] {5, 0, 0, 2, 1, 2, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new EntropyLDiversity("EDUC", 5, EntropyEstimator.GRASSBERGER)),
               "EDUC",
               "./data/ihis.csv",
               7735322.29514608,
               new int[] {0, 0, 0, 1, 3, 0, 0, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new EntropyLDiversity("EDUC", 2, EntropyEstimator.GRASSBERGER)),
               "EDUC",
               "./data/ihis.csv",
               5428093.534997522,
               new int[] {0, 0, 0, 0, 2, 0, 0, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new EntropyLDiversity("EDUC", 5, EntropyEstimator.SHANNON)),
               "EDUC",
               "./data/ihis.csv",
               1.2258628558792587E7,
               new int[] {0, 0, 0, 3, 3, 2, 0, 1},
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.0d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new EntropyLDiversity("EDUC", 100, EntropyEstimator.GRASSBERGER)),
               "EDUC",
               "./data/ihis.csv",
               0.0d,
               null,
               false)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.04d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(
                       new EntropyLDiversity("EDUC", 5, EntropyEstimator.GRASSBERGER)),
               "EDUC",
               "./data/ihis.csv",
               7735322.29514608,
               new int[] {0, 0, 0, 1, 3, 0, 0, 1},
               true)
         },
         {
           new ARXAnonymizationTestCase(
               ARXConfiguration.create(0.02d, Metric.createPrecomputedEntropyMetric(0.1d, true))
                   .addPrivacyModel(new EntropyLDiversity("EDUC", 3, EntropyEstimator.SHANNON)),
               "EDUC",
               "./data/ihis.csv",
               7578152.206004559,
               new int[] {0, 0, 0, 2, 2, 0, 0, 1},
               true)
         },
       });
 }