Project summary Large datasets generated by hospitals could have a transformative effect on medical knowledge and patient care. Yet currently the volume of data is more likely to overwhelm clinicians and the challenges of the data can overwhelm machine learning algorithms. Intensive care units (ICUs) generate data at a resolution of seconds, for the entirety of a patient's stay. Our long-term goal is to turn these data into actionable knowledge, like risk factors for a disease, early intervention targets, and real-time information to support clinical decisions. This is a broad problem, but particularly important in ICUs, which involve high stakes decisions being made in a complex environment under time pressure. We focus in particular on understanding consciousness in adults, and neurologic status in neonates. While 7% of ICU admissions are due to loss of consciousness, and degree of consciousness is critical to evaluating prognosis, making difficult choices such as when to withdraw care, and providing early interventions to improve quality of life, there are no objective or automated assessments for consciousness (adults) or neurologic status (neonates). We have shown that unresponsive patients with brain activation were twice as likely to regain the ability to follow commands compared to unresponsive patients without such activation, yet these assessments are too time consuming for regular clinical use. However we also showed that physiological data routinely collected in ICUs can be used as a proxy to classify consciousness. It is still not known why it changes and we must be sure that the patterns we find are in fact causal to avoid treating symptoms instead of a disease or launching unsuccessful clinical trials. There have been two key barriers preventing a causal understanding of consciousness. First, variables measured for each ICU patient differ, and can differ within a patient over the course of their admission. This leads to confounding when attempting to infer causal models, and has prevented learning a single model for all patients, which limits generalizability. Second, while the challenges of medical data require new methods, researchers are rarely able to rigorously evaluate and compare them, since real-world data lacks ground truth and often cannot be shared for privacy reasons. To address these challenges, we aim 1) to develop methods that learn generalizable causal models with latent variables (by intelligently sharing and combining information across patients), 2) to develop data driven simulations methods for testing machine learning algorithms while preserving privacy, and 3) to apply these methods to neonatal and neurological ICU data. We aim to create better indicators for consciousness and to uncover causes of both neurological status in ICU and its link to long-term functional outcomes. Our work turns potential weaknesses of medical data (different variables measured across individuals) into a strength, and will enable better use of large-scale observational biomedical data for real-time treatment decisions.