def test_rmse(self): y = [1, 2, 3, 4, 5, 6, 7, 8, 9] estimate = [1, 4, 9, 16, 25, 36, 49, 64, 81] result = ps5.rmse(pylab.array(y), pylab.array(estimate)) correct = 35.8515457593 self.assertTrue(math.isclose(correct, result), "RMSE value incorrect") y = [1, 1, 1, 1, 1, 1, 1, 1, 1] estimate = [1, 4, 9, 16, 25, 36, 49, 64, 81] result = ps5.rmse(pylab.array(y), pylab.array(estimate)) correct = 40.513372278 self.assertTrue(math.isclose(correct, result), "RMSE value incorrect")
def test_rmse(self): y = [1, 2, 3, 4, 5, 6, 7, 8, 9] estimate = [1, 4, 9, 16, 25, 36, 49, 64, 81] result = ps5.rmse(pylab.array(y), pylab.array(estimate)) correct = 35.8515457593 # change made for Python if version < 3.0 isclose1 = correct - result < 0.01 self.assertTrue(isclose1, "RMSE value incorrect") y = [1, 1, 1, 1, 1, 1, 1, 1, 1] estimate = [1, 4, 9, 16, 25, 36, 49, 64, 81] result = ps5.rmse(pylab.array(y), pylab.array(estimate)) correct = 40.513372278 # change made for Python if version < 3.0 isclose2 = correct - result < 0.01 self.assertTrue(isclose2, "RMSE value incorrect")