def test_calculate_metric_mean_absolute_error(): yt = [1, 1, 1, 1] yp = [1, 1, 1, 0] metrics = ["mean_absolute_error"] s = Scorer() assert s.calculate_metrics(yt, yp, metrics) == { "mean_absolute_error": 0.25 }
def test_calculate_metric_silhouette_score(): yt = [1, 1, 1, 1] yp = [1, 1, 1, 0] metrics = ["SC"] s = Scorer() assert s.calculate_metrics(np.vstack((yt, yt, yp, yp)), yp, metrics) == { "SC": 0.0 }
def test_calculate_metric_HCV(): yt = [1, 1, 1, 1] yp = [1, 1, 1, 0] metrics = ["HCV"] s = Scorer() assert s.calculate_metrics(yt, yp, metrics) == {"HCV": 1.0}
def test_calculate_metric_accuracy(): yt = [1, 1, 1, 1] yp = [1, 1, 1, 0] metrics = ["accuracy"] s = Scorer() assert s.calculate_metrics(yt, yp, metrics) == {"accuracy": 0.75}