def test_rmse(self): rmse = RMSE() self.assertEqual(rmse.type, 'rating') self.assertEqual(rmse.name, 'RMSE') self.assertEqual(0, rmse.compute(np.asarray([0]), np.asarray([0]))) self.assertEqual(1, rmse.compute(np.asarray([0, 1]), np.asarray([1, 0]))) self.assertEqual(2, rmse.compute(np.asarray([0, 1]), np.asarray([2, 3]), np.asarray([1, 3])))
def test_rmse(): rmse = RMSE() assert rmse.type == 'rating' assert rmse.name == 'RMSE' assert 0 == rmse.compute(np.asarray([0]), np.asarray([0])) assert 1 == rmse.compute(np.asarray([0, 1]), np.asarray([1, 0])) assert 2 == rmse.compute(np.asarray([0, 1]), np.asarray([2, 3]), np.asarray([1, 3]))