Exemple #1
0
  @Test
  public void testWithin25KmAccuracy() {
    assertNotNull(reader1);

    SocialNetwork network1 = reader1.getSocialNetwork();
    assertNotNull(network1);

    GroundTruth gt1 = reader1.getGroundTruth();
    assertNotNull(gt1);

    InferenceAlgorithm simpleAlgo = mp1.GetSimpleInferenceAlgorithm(network1);
    assertNotNull(simpleAlgo);
    assertTrue(simpleAlgo instanceof SimpleInferenceAlgorithm);

    Evaluator evaluator = Evaluator.getInstance();
    assertNotNull(evaluator);

    Metric within25KmAccuracyMetric = new WithinXkmMetric(25.0);
    double normalizedError = evaluator.EvaluateInference(simpleAlgo, gt1, within25KmAccuracyMetric);
    double averageAccuracy = 1.0 - normalizedError;

    assertTrue(averageAccuracy > 0 && averageAccuracy < 1.0);

    System.out.println(
        "Info: testWithin25KmAccuracy - averageAccuracy: " + averageAccuracy * 100.0 + "%");
  }
Exemple #2
0
  @Test
  public void testGetSimpleInferenceAlgorithm() {
    assertNotNull(reader1);
    SocialNetwork network1 = reader1.getSocialNetwork();
    assertNotNull(network1);

    InferenceAlgorithm simpleAlgo = mp1.GetSimpleInferenceAlgorithm(network1);
    assertNotNull(simpleAlgo);
    assertTrue(simpleAlgo instanceof SimpleInferenceAlgorithm);
  }