Abstract Machine learning (ML) is being hailed as a new direction of innovation to transform future optical communication systems. Signal processing paradigms based on ML are being considered to solve certain critical problems in optical communications that cannot be easily tackled using conventional approaches. Recent applications of ML in various aspects of optical communications and networking such as nonlinear transmission systems, network planning and performance prediction, cross-layer network optimizations for software-defined networks, and autonomous and reliable network operations have shown promising results. However, to comprehend true potential of ML in optical communications, a basic understanding of the nature of ML concepts is indispensable. In this chapter we describe mathematical foundations of several key ML methods from communication theory and signal processing perspectives and highlight the types of problems in optical communications and networking where they can be useful. We also provide an overview of existing ML applications in optical communication systems with an emphasis on physical layer.