def test_l1_log_loss_with_observed(): E = np.array([0, 1, 1]) actual = np.array([1, 1, 1]) predicted = np.array([1, 1, 1]) assert utils.l1_log_loss(actual, predicted, E) == 0.0 predicted = np.array([2, 1, 1]) assert utils.l1_log_loss(actual, predicted, E) == 0.0
def test_l1_log_loss_with_no_observed(): actual = np.array([1, 1, 1]) predicted = np.array([1, 1, 1]) assert utils.l1_log_loss(actual, predicted) == 0.0 predicted = predicted + 1 assert utils.l1_log_loss(actual, predicted) == np.log(2)