A relationship between the average precision and the area under the ROC curve