How to select a threshold for acting using confidence scores