mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-17 16:35:54 +00:00
Add results list and experiments.txt
This commit is contained in:
@@ -700,15 +700,23 @@ class Summary:
|
|||||||
self.datasets[result] = report.lines
|
self.datasets[result] = report.lines
|
||||||
self.data.append(entry)
|
self.data.append(entry)
|
||||||
|
|
||||||
def list(self) -> None:
|
def list(self, score=None, model=None) -> None:
|
||||||
"""Print the list of results"""
|
"""Print the list of results"""
|
||||||
max_length = max(len(x["file"]) for x in self.data)
|
data = self.data.copy()
|
||||||
|
if score:
|
||||||
|
data = [x for x in data if x["score"] == score]
|
||||||
|
if model:
|
||||||
|
data = [x for x in data if x["model"] == model]
|
||||||
|
max_file = max(len(x["file"]) for x in data)
|
||||||
|
max_title = max(len(x["title"]) for x in data)
|
||||||
|
print(f"{'File':{max_file}s} {'Score':7s} {'Title':s}")
|
||||||
|
print("=" * max_file + " " + "=" * 7 + " " + "=" * max_title)
|
||||||
print(
|
print(
|
||||||
"\n".join(
|
"\n".join(
|
||||||
[
|
[
|
||||||
f"{x['file']:{max_length}s} {x['metric']:7.3f} "
|
f"{x['file']:{max_file}s} {x['metric']:7.3f} "
|
||||||
f"{x['title']}"
|
f"{x['title']}"
|
||||||
for x in self.data
|
for x in data
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
5
src/experiments.txt
Normal file
5
src/experiments.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Experiments to do:
|
||||||
|
Bagging
|
||||||
|
|
||||||
|
Odte
|
||||||
|
Random Forest
|
40
src/list.py
Normal file
40
src/list.py
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import argparse
|
||||||
|
from Results import Summary
|
||||||
|
|
||||||
|
"""List experiments of a model
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def parse_arguments():
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument(
|
||||||
|
"-x",
|
||||||
|
"--excel",
|
||||||
|
type=bool,
|
||||||
|
required=False,
|
||||||
|
help="Generate Excel file",
|
||||||
|
)
|
||||||
|
ap.add_argument(
|
||||||
|
"-s",
|
||||||
|
"--score",
|
||||||
|
type=str,
|
||||||
|
required=False,
|
||||||
|
help="score used in experiment",
|
||||||
|
)
|
||||||
|
ap.add_argument(
|
||||||
|
"-m",
|
||||||
|
"--model",
|
||||||
|
type=str,
|
||||||
|
required=False,
|
||||||
|
help="model used in experiment",
|
||||||
|
)
|
||||||
|
args = ap.parse_args()
|
||||||
|
|
||||||
|
return (args.excel, args.score, args.model)
|
||||||
|
|
||||||
|
|
||||||
|
(excel, score, model) = parse_arguments()
|
||||||
|
|
||||||
|
data = Summary()
|
||||||
|
data.acquire()
|
||||||
|
data.list(score, model)
|
Reference in New Issue
Block a user