Pretrial detention is a debated and controversial measure since it is an exception to the principle of the presumption of innocence. To determine whether and to what extent legal systems make excessive use of pretrial detention, an empirical analysis of judicial practice is needed. The paper presents some preliminary results of experimental research aimed at identifying the relevant factors on the basis of which Italian and Brazilian Supreme Courts impose the measure. To analyze and extract the relevant predictive-features, we rely on unsupervised learning approaches, in particular association and clustering methods. As a result, we found common factors between the two legal systems in terms of crime, location, grounds for appeal, and judge’s reasoning.