def test_03_rmse_nan(self): """Test that RMSE fails when NaN is present""" predicted = self.predicted predicted[4] = np.NaN error = rmse(predicted, self.truth) self.assertEqual(np.inf, error)
def test_04_rmse_datatype(self): """Test that RMSE fails when wrong data type is passed""" error = rmse(list(self.predicted), self.truth) self.assertEqual(np.inf, error)
def test_02_rmse_shape(self): """Test that RMSE fails when shapes do not match""" error = rmse(self.predicted[:-2], self.truth) self.assertEqual(np.inf, error)
def test_01_rmse(self): """Test that RMSE is calculated""" error = rmse(self.predicted, self.truth) self.assertEqual(self.error, error)