Created
September 21, 2016 15:37
-
-
Save hongthaiphi/a2bef91bced0715927b00a4d4c5be1af 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
def evaluate_recall(y, y_test, k=1): | |
num_examples = float(len(y)) | |
num_correct = 0 | |
for predictions, label in zip(y, y_test): | |
if label in predictions[:k]: | |
num_correct += 1 | |
return num_correct/num_examples |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment