An Introduction to Statistical Learning with Applications in R, Gareth James, Daniela Witten, Trevor Hastie, and Robert Tibshirani, 2013 (Springer) - This book explains statistical learning methods at an introductory level, including the definition and practical application of residuals in linear regression.
The Elements of Statistical Learning: Data Mining, Inference, and Prediction, Trevor Hastie, Robert Tibshirani, and Jerome Friedman, 2009 (Springer) - A comprehensive textbook that provides a theoretical treatment of statistical learning, detailing residuals within the context of linear regression models.
Introductory Econometrics: A Modern Approach, Jeffrey M. Wooldridge, 2019 (Cengage Learning) - This widely used econometrics textbook defines prediction errors (residuals) within the context of linear regression, focusing on their role in model estimation and analysis.