Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
    def test_01_rmse(self):
        """Test that RMSE is calculated"""

        error = rmse(self.predicted, self.truth)
        self.assertEqual(self.error, error)