Example #1
0
 def test_dunn_regression(self):
     dunn_calculator = DunnCalculator()
     
     expected = [0.238095238095, 0.238095238095]
     
     for i in range(len(self.clusterings)):
         self.assertAlmostEqual( dunn_calculator.evaluate( self.clusterings[i], self.matrix), expected[i],6)
Example #2
0
    def test_dunn_regression(self):
        dunn_calculator = DunnCalculator()

        expected = [0.238095238095, 0.238095238095]

        for i in range(len(self.clusterings)):
            self.assertAlmostEqual(
                dunn_calculator.evaluate(self.clusterings[i], self.matrix),
                expected[i], 6)
Example #3
0
 def test_max_intercluster_distance(self):
     expected = [21, 21]
     for i in range(len(self.clusterings)):
         self.assertEqual( DunnCalculator.max_intercluster_distance(self.clusterings[i], self.matrix), expected[i])
Example #4
0
 def test_min_intracluster_distances(self):
     expected = [5, 5]
     for i in range(len(self.clusterings)):
         self.assertEqual(DunnCalculator.min_intracluster_distances(self.clusterings[i], self.matrix), expected[i])
Example #5
0
 def test_max_intercluster_distance(self):
     expected = [21, 21]
     for i in range(len(self.clusterings)):
         self.assertEqual(
             DunnCalculator.max_intercluster_distance(
                 self.clusterings[i], self.matrix), expected[i])
Example #6
0
 def test_min_intracluster_distances(self):
     expected = [5, 5]
     for i in range(len(self.clusterings)):
         self.assertEqual(
             DunnCalculator.min_intracluster_distances(
                 self.clusterings[i], self.matrix), expected[i])