def error_calculation_test(self):
        tsOrg  = TimeSeries()
        tsCalc = TimeSeries()

        for idx in xrange(len(self.dataOrg)):
            tsOrg.add_entry(float(idx),  self.dataOrg[idx])
            tsCalc.add_entry(float(idx), self.dataCalc[idx])

        mape = MeanAbsolutePercentageError()
        mape.initialize(tsOrg, tsCalc)

        self.assertEquals("139.78", str(mape.get_error())[:6])


#    def local_error_test(self):
#        orgValues = [11, 33.1, 2.3, 6.54, 123.1, 12.54, 12.9]
#        calValues = [24, 1.23, 342, 1.21, 4.112, 9.543, 3.54]
#
#        mape = MeanAbsolutePercentageError()
#        for idx in xrange(len(orgValues)):
#            res = ((math.fabs(calValues[idx] - orgValues[idx]))/orgValues[idx])*100
#            assert  str(res)[:6] == str(mape.local_error([orgValues[idx]], [calValues[idx]]))[:6]
#
#    def error_calculation_test(self):
#        """Test the calculation of the MeanAbsolutePercentageError."""
#        dataOrg         = [[1,1], [2,2], [3,3], [4,4], [5,5], [6,6], [7,8], [7.3, 5], [8, 0], [9,10], [10, -10]]
#        dataCalc        = [[1,3], [2,5], [3,0], [4,3], [5,5], [6.1,6], [7,3], [7.3, 5], [8, 0], [9,9], [10, -15]]
#        # abs difference:     2      3      3      1      0       NA      5    0         NA       1         5
#        # local errors:       200    150    100    25     0       NA      62,5 0         NA       10        50
#        # sum: 597,5
#
#        tsOrg  = TimeSeries.from_twodim_list(dataOrg)
#        tsCalc = TimeSeries.from_twodim_list(dataCalc)
#
#        mape = MeanAbsolutePercentageError()
#        mape.initialize(tsOrg, tsCalc)
#        assert str(mape.get_error())[:6] == "66.388"
Test the calculation of the MeanAbsolutePercentageError.
dataset/ETHPy150Open T-002/pycast/pycast/tests/meanabsolutepercentageerrortest.py/MeanAbsolutePercentageErrorTest.error_calculation_test