# Prediction Vs Forecasting in Supervised Learning

In supervised learning and especially in the context of Linear regression, we often use these two terms: **Prediction** and **Forecast**. We also use **Forecast** more often in time series problems. Do they mean the same? Can they be used interchangeably? There are differences especially in the context of machine learning.

Let us understand the nuances of each of these today.

## Prediction

**Prediction**, as the word says, is about estimating the outcome for unseen data. For this, you fit a model on a training data set and use that model to predict the outcome for any unseen data.

In prediction, we do not make any assumptions about the shape of the data except that there is a linear dependency of the target variable on the independent variables and that is explained by a model** f(x)** (x could be a set of predictors, x1, x2, x3,..., xn)

Once the model is known, the model is used to **interpolate** a target variable based on a new set of unseen independent variables.

Though it may not always be true, most often, we use predictive models for understanding the impact of the independent variables on the target variable. Hence you want to keep the model as simple as possible.

For example, you have a use case where the number of viewers of a TV show is reducing. You want to fit a model to understand this behaviour, based on various factors like the actors, the plot of the show, the days of the week the show airs, the competing shows that have come at the same hour etc. You do a "multiple linear regression" and get a model. As soon as you have the model, you can see which predictors are more influential and with that insight, you can take corrective actions. You can even predict based on a few tweaks, what is the impact on viewership.

Here you are not very keen on high accuracy of the prediction but you are keen on knowing the cause for the change in the outcome. Actionables are expected usually, from these predictive models.

## Forecasting

**Forecasting** is a sub-discipline of Prediction where you are predicting for a future point in time.

For example, weather forecasting. We would not say weather prediction. Similarly, we say, sales forecasting. Given a lot of historical sales, you come up with a model, using which you forecast for a future date.

This kind of sales forecasting is valid provided the conditions remain the same as the conditions of the training data. If the training data is for a non-festive period, then, the forecast will also work for the same. But it will certainly not work for a festive period.

This implies that we making an assumption that the conditions remain the same for the forecast to hold true. If this assumption changes, then, the forecast could completely go wrong.

In fact, the language used when you give a forecast, is different. You often say that conditions remaining the same, the forecast is a specific value. This is seen as an **extrapolation** of the data from the existing time frame to a future time frame.

Also, regarding the outcome, here most often, you are looking for higher accuracy and not really for understanding the impact of the independent variables on the target variable. Hence there is a tendency to make the model complex, as the goal is different.

## With An Example

Let us look at a very simplistic example. You have data that shows how salary varies with years of experience. Clearly, there is a linear dependence between these two variables as shown in the diagram below

Note here, if you want to "predict" what might be the salary for someone with 6.5 years of experience, you can interpolate as shown by the green dot and line and you can derive that the salary is probably around 90000 units. Using this linear equation formula you can predict for any number of years of experience in the given range of 1.1 to 10.3 years of experience, for which we have data. You could go beyond 10.3 years too but no guarantees there as you have no data to substantiate that the prediction is still linear after 10.3 years.

Let us look at an example that has the temporal component to it.

This is a graph that shows the increase in Airline passenger traffic with time. This has a linear component and a seasonal component. For the discussion sake here, kindly ignore the seasonal component. Assume, you separate out the linear growth and the seasonal shape and you will see that over the years, there is steady linear growth. You can use this data to come up with the linear growth expected, say in 1962.

You are using all of the historical data to come up with what might be a future passenger load in 1962, which is nothing but an extrapolation. This is called forecasting.

It must strike you here that the forecasting will be accurate only if the conditions of the historical data and the future remain the same.

### Summary:

Most often, non-temporal use cases with interpolation are termed predictions and temporal based extrapolation is called forecasting.

Kindly share your thoughts below, it will be highly appreciated :)

## Comments