Created
September 21, 2016 15:41
-
-
Save hongthaiphi/a0a87d6737780e0c65fa67f3723c0676 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
# Random Predictor | |
def predict_random(context, utterances): | |
return np.random.choice(len(utterances), 10, replace=False) | |
# Evaluate Random predictor | |
y_random = [predict_random(test_df.Context[x], test_df.iloc[x,1:].values) for x in range(len(test_df))] | |
y_test = np.zeros(len(y_random)) | |
for n in [1, 2, 5, 10]: | |
print("Recall @ ({}, 10): {:g}".format(n, evaluate_recall(y_random, y_test, n))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment