Add new stat in analysis_mysql

generate new report.csv
This commit is contained in:
2021-03-16 13:31:51 +01:00
parent da8b76679d
commit 0ec9e4d85d
3 changed files with 363 additions and 270 deletions

View File

@@ -103,10 +103,11 @@ def report_footer(agg):
color + f"{item:10s} used {agg[item]['items']:2d} times ", end=""
)
print(
color + f"better {agg[item]['better']:2d} times ",
color + f"better than reference {agg[item]['better']:2d} times ",
end="",
)
print(color + f"worse {agg[item]['worse']:2d} times ")
print(color + f"worse {agg[item]['worse']:2d} times ", end="")
print(color + f"best of models {agg[item]['best']:2d} times")
color = (
TextColor.LINE2 if color == TextColor.LINE1 else TextColor.LINE1
)
@@ -131,6 +132,7 @@ for item in [
agg[item]["items"] = 0
agg[item]["better"] = 0
agg[item]["worse"] = 0
agg[item]["best"] = 0
if csv_output:
f = open(report_csv, "w")
print("dataset, classifier, accuracy", file=f)
@@ -159,11 +161,13 @@ for dataset in dt:
agg[model]["worse"] += 1
item = f"{accuracy:9.7} {sign}"
line["reference"] = f"{reference:9.7}"
line[model] = (
TextColor.GREEN + TextColor.BOLD + item + TextColor.ENDC
if accuracy == max_accuracy
else color + item
)
if accuracy == max_accuracy:
line[model] = (
TextColor.GREEN + TextColor.BOLD + item + TextColor.ENDC
)
agg[model]["best"] += 1
else:
line[model] = color + item
if csv_output:
print(f"{dataset[0]}, {model}, {accuracy}", file=f)
if not find_one: