1. A computer-implemented method, comprising: computing, by a computing device, a first set of activity probabilities based on contextual information for a first set of historical activities and an activity-prediction model for a target activity, wherein an activity probability indicates a likelihood that the target activity has occurred; comparing a first set of probability thresholds with the first set of activity probabilities to determine a prediction success rate for each probability threshold; computing a utility score for each probability threshold based on the prediction success rates and a utility function, wherein the utility function has the form: 
 U ( P th )= U 1 (TP)+ U 2 (FP)+ U 3 (FN)+ U 4 (TN); wherein P th is the threshold value used to determine whether a historical activity matches the target activity, wherein U 1 (TP) and U 4 (TN) compute a benefit of making a recommendation based on predicting a true positive and a true negative, respectively, and wherein U 2 (FP) and U 3 (FN) compute a cost of making a recommendation based on predicting a false positive and a false negative, respectively; selecting a first probability threshold whose utility score is greater than or equal to a baseline utility score and other utility scores of the first set of thresholds; and assigning the first probability threshold to the activity-prediction model.