Doctors struggle to accurately predict pneumonia patients’ prognoses and determine the most effective treatments. Now, by applying a sophisticated machine-learning approach to electronic health records (EHRs) of patients with pneumonia, researchers uncovered five distinct clinical states in pneumonia.