Lineal regression
If we want to predict a quantitative value, regression is a great tool due to it uses. It's an independent variable to explain the behavior of a phenomenon such as temperature, asset prices, house prices, and so on. Linear regression finds the best fitting in a straight line.
We use regression or forecast all the time in our daily lives: when we calculate the gas or the time required for a car trip based on previous data (distance, traffic, weather, and so on). In its simplest form, you can think of it in this way: first, get previous data from the phenomena, for example, how much time was spent on previous trips and what was the distance. Then, look at the values form, and try to find a metric to forecast the next value.
In this section, we will program a very simple example of linear regression using scikit-learn, which is a machine-learning library for Python. For this concrete example, we will use the Boston Housing dataset, which represents the data of 506 neighborhoods...