Skip to content
Snippets Groups Projects
Commit 5df4201e authored by William Bell's avatar William Bell
Browse files

Correcting formatting.

parent 13bdbe8b
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,6 @@ def average_precision(relevant_ranks: list, precision: list) -> list:
each rank.
"""
n = len(precision)
ranks = list(range(1, n+1))
results = [0.] * n
n_relevant = [0] * n
......
......@@ -20,13 +20,13 @@ average_precision_vs_rank = analysis_functions.average_precision(query_results[1
# Plot the average precision.
analysis_plots.line_plot("average_precision.png",
rank,
average_precision_vs_rank,
labels={
rank,
average_precision_vs_rank,
labels={
"title": "Average precision vs rank for query 1",
"xlabel": "Rank",
"ylabel": "Average precision"
})
})
# The average precision at the highest rank.
print(f"Average precision, after all ranks = {average_precision_vs_rank[-1]}")
......
......@@ -73,10 +73,10 @@ for i in range(n):
# Plot the average values.
analysis_plots.line_plot("precision_vs_recall_average.png",
recall_points,
precision_average,
labels={
"title": f"Average from {len(query_results.keys())} queries",
"xlabel": "Recall",
"ylabel": "Precision"
})
recall_points,
precision_average,
labels={
"title": f"Average from {len(query_results.keys())} queries",
"xlabel": "Recall",
"ylabel": "Precision"
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment