Abstract
In this chapter, we delve into linear regression, a fundamental machine learning
algorithm for predicting numerical values. While maintaining a concise overview of the
mathematical theories, we prioritize an accessible approach by focusing on a concrete
numerical example with a small dataset for predicting house sale prices. Through a step-bystep walkthrough, we illustrate the inner workings of linear regression and demonstrate its
practical implementation. Additionally, we offer sample codes and a comparison with the linear
regression model from scikit-learn to reinforce understanding. Upon completing this chapter,
readers will gain a comprehensive understanding of linear regression's inner workings and its
relationship to algorithm implementation and performance, and be better prepared to apply it
to real-world projects.