Best-fit lines and the least-squares method
In this section, we will learn about best-fit lines and the least-squares method and see some very simple plots to enforce these concepts. Best-fit lines will be used to fit a dataset, and through doing this, it is made sure that the least-squares error is minimized.
Variable
A variable is a feature that does not have a fixed value. For example, let's say you want to buy a car and the most important feature for you is horsepower. You then go ahead and look at different car models to compare the horsepower values. Here the horsepower is a variable, since it takes different values based on the car model.
Linear relationship
Linear relationship is a term used to describe a straight-line relationship. This can be expressed mathematically as the equation of a line.
For example, if you are interested in finding the relationship between two variables, such as horsepower and weight, for different cars, and if the horsepower...