wrap funny analysis in SHOWOFF env
This commit is contained in:
parent
099c7f8fc9
commit
7c94afb01e
41
main.py
41
main.py
|
@ -335,7 +335,8 @@ async def scores(ctx):
|
||||||
}
|
}
|
||||||
|
|
||||||
normalized_scores = {
|
normalized_scores = {
|
||||||
model: summed_scores[model] / len(all_hashes) for model in summed_scores
|
model: round(summed_scores[model] / len(all_hashes), 10)
|
||||||
|
for model in summed_scores
|
||||||
}
|
}
|
||||||
|
|
||||||
print("scores are [worst...best]")
|
print("scores are [worst...best]")
|
||||||
|
@ -346,29 +347,29 @@ async def scores(ctx):
|
||||||
reverse=True,
|
reverse=True,
|
||||||
):
|
):
|
||||||
print(model, normalized_scores[model])
|
print(model, normalized_scores[model])
|
||||||
|
if os.getenv("SHOWOFF", "0") == "1":
|
||||||
|
print("[", end="")
|
||||||
|
|
||||||
print("[", end="")
|
for bad_md5_hash in sorted(
|
||||||
|
model_scores[model].keys(),
|
||||||
|
key=lambda md5_hash: model_scores[model][md5_hash]["score"],
|
||||||
|
)[:4]:
|
||||||
|
data = model_scores[model][bad_md5_hash]
|
||||||
|
if os.getenv("DEBUG", "0") == "1":
|
||||||
|
print(md5_hash, data["score"], " ".join(data["incorrect_tags"]))
|
||||||
|
else:
|
||||||
|
print(data["score"], end=",")
|
||||||
|
print("...", end="")
|
||||||
|
|
||||||
for bad_md5_hash in sorted(
|
for good_md5_hash in sorted(
|
||||||
model_scores[model].keys(),
|
model_scores[model].keys(),
|
||||||
key=lambda md5_hash: model_scores[model][md5_hash]["score"],
|
key=lambda md5_hash: model_scores[model][md5_hash]["score"],
|
||||||
)[:4]:
|
reverse=True,
|
||||||
data = model_scores[model][bad_md5_hash]
|
)[:4]:
|
||||||
if os.getenv("DEBUG", "0") == "1":
|
data = model_scores[model][good_md5_hash]
|
||||||
print(md5_hash, data["score"], " ".join(data["incorrect_tags"]))
|
|
||||||
else:
|
|
||||||
print(data["score"], end=",")
|
print(data["score"], end=",")
|
||||||
print("...", end="")
|
|
||||||
|
|
||||||
for good_md5_hash in sorted(
|
print("]")
|
||||||
model_scores[model].keys(),
|
|
||||||
key=lambda md5_hash: model_scores[model][md5_hash]["score"],
|
|
||||||
reverse=True,
|
|
||||||
)[:4]:
|
|
||||||
data = model_scores[model][good_md5_hash]
|
|
||||||
print(data["score"], end=",")
|
|
||||||
|
|
||||||
print("]")
|
|
||||||
print("most incorrect tags", incorrect_tags_counters[model].most_common(5))
|
print("most incorrect tags", incorrect_tags_counters[model].most_common(5))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue