Understanding Detention and Predicting Prosecutions