This article discusses the increasing use of deep neural networks (DNNs) in various fields, including computer vision, audio processing, and natural language processing. The availability of open-source datasets, computational resources, and algorithms has contributed to the success of DNNs. The article also highlights the challenges involved in using DNNs in real-life safety-critical domains, such as autonomous driving and healthcare. The author presents a thesis that addresses data science challenges in learning prediction models from electronic health records, with a focus on predicting adverse outcomes for individual patients. The thesis includes five articles and proposes solutions for representing complex clinical concepts, modeling sequential structures, and quantifying prediction uncertainties.