Exemplo n.º 1
0
 def testMeanAbsError(self): 
     testY = numpy.array([1, 2, 1.5])
     predY = numpy.array([2, 1, 0.5]) 
     
     self.assertEquals(Evaluator.meanAbsError(testY, predY), 1.0)
     self.assertEquals(Evaluator.meanAbsError(testY, testY), 0.0)
     
     testY = numpy.random.rand(10)
     predY = numpy.random.rand(10)
     
     error = numpy.abs(testY - predY).mean()
     self.assertEquals(error, Evaluator.meanAbsError(testY, predY))
Exemplo n.º 2
0
    def testMeanAbsError(self):
        testY = numpy.array([1, 2, 1.5])
        predY = numpy.array([2, 1, 0.5])

        self.assertEquals(Evaluator.meanAbsError(testY, predY), 1.0)
        self.assertEquals(Evaluator.meanAbsError(testY, testY), 0.0)

        testY = numpy.random.rand(10)
        predY = numpy.random.rand(10)

        error = numpy.abs(testY - predY).mean()
        self.assertEquals(error, Evaluator.meanAbsError(testY, predY))