Time Series Forecasting Basics
Machine Learning · Intermediate
Definition
Time series models predict future values from past ordered data, using trend, seasonality and lags.
Used for sales, stock, weather and demand forecasting.
Diagram
Flowchart
Example: Moving average forecast
sales = [10, 12, 14, 16]
print(sum(sales[-3:]) / 3)Output: 14.0
Key points
- Never shuffle time series
- ARIMA, Prophet and LSTMs are common models
Interview questions
Why not random train/test split?
It leaks future information into training.