Created
June 14, 2024 00:59
-
-
Save calebdre/c9fb70c9cc25f5d513cf76989bca47de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const calculateMAPAtK = ( | |
sampleQueries: SampleQuery[], | |
retrievedResults: QueryResult[][], | |
k: number | |
) => { | |
const apScores = sampleQueries.map((query, index) => { | |
return calculateAveragePrecision(query, retrievedResults[index], k); | |
}); | |
return apScores.reduce((sum, score) => sum + score, 0) / apScores.length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment