def testRandIndex(self): 
        clustering1 = numpy.array([1, 1, 1, 2, 2, 2])
        clustering2 = numpy.array([2, 2, 2, 1, 1, 1])
        
        self.assertEquals(GraphUtils.randIndex(clustering1, clustering2), 0.0)
        
        clustering2 = numpy.array([2, 2, 2, 1, 1, 2])
        self.assertEquals(GraphUtils.randIndex(clustering1, clustering2), 1/3.0) 
        
        clustering2 = numpy.array([1, 2, 2, 1, 1, 2])
        self.assertEquals(GraphUtils.randIndex(clustering1, clustering2), 16/30.0)
dataset/ETHPy150Open charanpald/APGL/apgl/graph/test/GraphUtilsTest.py/AbstractMatrixGraphTest.testRandIndex/original