Esempio n. 1
0
    def test_mean_squared_log_error(self):
        eva = Evaluation()
        y_true = [3, 5, 2.5, 7]
        y_pred = [2.5, 5, 4, 8]
        self.assertFloatEqual(np.around(eva.mean_squared_log_error(y_true, y_pred), 4), 0.0397)

        y_true = [[0.5, 1], [1, 2], [7, 6]]
        y_pred = [[0.5, 2], [1, 2.5], [8, 8]]
        self.assertFloatEqual(np.around(eva.mean_squared_log_error(y_true, y_pred), 4), 0.0442)
Esempio n. 2
0
    def test_mean_squared_log_error(self):
        eva = Evaluation()
        eva._init_model(EvaluateParam(eval_type=consts.REGRESSION,
                                      pos_label=1))
        y_true = [3, 5, 2.5, 7]
        y_pred = [2.5, 5, 4, 8]
        self.assertFloatEqual(
            np.around(eva.mean_squared_log_error(y_true, y_pred), 4), 0.0397)

        y_true = [[0.5, 1], [1, 2], [7, 6]]
        y_pred = [[0.5, 2], [1, 2.5], [8, 8]]
        self.assertFloatEqual(
            np.around(eva.mean_squared_log_error(y_true, y_pred), 4), 0.0442)