mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-15 15:35:52 +00:00
replace pairtest lose test
This commit is contained in:
@@ -1252,6 +1252,7 @@ class PairCheck:
|
||||
self.score_b = report_b.score
|
||||
for result_a, result_b in zip(report_a.lines, report_b.lines):
|
||||
result = result_a["score"] - result_b["score"]
|
||||
|
||||
if result > 0:
|
||||
self.winners.append(result_a["dataset"])
|
||||
elif result < 0:
|
||||
|
@@ -41,7 +41,9 @@ class PairCheckTest(unittest.TestCase):
|
||||
self.assertEqual(computed, expected)
|
||||
|
||||
def test_pair_check_lose(self):
|
||||
report = self.build_model(lose=True)
|
||||
report = self.build_model(
|
||||
model1="RandomForest", model2="STree", lose=True
|
||||
)
|
||||
report.compute()
|
||||
with patch("sys.stdout", new=StringIO()) as fake_out:
|
||||
report.report()
|
||||
|
@@ -3,7 +3,6 @@ import unittest
|
||||
from io import StringIO
|
||||
from unittest.mock import patch
|
||||
from ..Results import Summary
|
||||
from ..Utils import Symbols
|
||||
|
||||
|
||||
class SummaryTest(unittest.TestCase):
|
||||
@@ -232,3 +231,15 @@ class SummaryTest(unittest.TestCase):
|
||||
),
|
||||
}
|
||||
self.assertSequenceEqual(computed, expected)
|
||||
|
||||
def test_show_top(self):
|
||||
report = Summary()
|
||||
report.acquire()
|
||||
with patch("sys.stdout", new=StringIO()) as fake_out:
|
||||
report.show_top()
|
||||
computed = fake_out.getvalue()
|
||||
with open(
|
||||
os.path.join("test_files", "summary_show_top.test"), "r"
|
||||
) as f:
|
||||
expected = f.read()
|
||||
self.assertEqual(computed, expected)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
Model File Score Win Tie Lose
|
||||
==================== ====================================================================== ========== === === ====
|
||||
STree results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json 0.04544
|
||||
RandomForest results_accuracy_RandomForest_iMac27_2022-01-14_12:39:30_0.json 0.03627 [92m 2 [93m 0 [91m 0
|
||||
RandomForest results_accuracy_RandomForest_iMac27_2022-01-14_12:39:30_0.json 0.03627
|
||||
STree results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json 0.04544 [92m 0 [93m 0 [91m 2
|
||||
[91mlosers:
|
||||
[]
|
||||
['balance-scale', 'balloons']
|
||||
|
7
benchmark/tests/test_files/summary_show_top.test
Normal file
7
benchmark/tests/test_files/summary_show_top.test
Normal file
@@ -0,0 +1,7 @@
|
||||
[94mDate File Score Time(h) Title
|
||||
========== =============================================================== ======== ======= ============================================
|
||||
[96m2021-09-30 results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json 0.04544 0.173 With gridsearched hyperparameters
|
||||
[94m2022-04-20 results_accuracy_ODTE_Galgo_2022-04-20_10:52:20_0.json 0.04341 6.275 Gridsearched hyperparams v022.1b random_init
|
||||
[96m2021-10-27 results_accuracy_STree_iMac27_2021-10-27_09:40:40_0.json 0.04158 0.943 default A
|
||||
[94m2021-11-01 results_accuracy_STree_macbook-pro_2021-11-01_19:17:07_0.json 0.03790 1.143 default B
|
||||
[96m2022-01-14 results_accuracy_RandomForest_iMac27_2022-01-14_12:39:30_0.json 0.03627 0.076 Test default paramters with RandomForest
|
Reference in New Issue
Block a user