Exemple #1
0
  @Test
  public void testIris() throws ScoreException {
    double scoreBetter = subject.score(FakeClustering.iris());
    double scoreWorser = subject.score(FakeClustering.irisWrong4());

    // should recognize better clustering
    assertEquals(true, subject.isBetter(scoreBetter, scoreWorser));
  }
Exemple #2
0
 /**
  * Check against definition (and tests in R package clusterCrit)
  * https://cran.r-project.org/web/packages/clusterCrit/index.html
  *
  * <p>NOTE: There's a small problem with precision of floating point operations. First 7 decimal
  * digits seems to match.
  */
 @Test
 public void testClusterCrit() throws ScoreException {
   double score = subject.score(FakeClustering.int100p4());
   // clustCrit: 105.942129943902
   assertEquals(105.942129943902, score, delta);
 }