Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alejo1630/time_series_analysis
This Python notebook provides a comprehensive analysis of time series data using different machine learning models. 🔰 What is it about?
https://github.com/alejo1630/time_series_analysis
forecasting notebook-jupyter python time-series-analysis
Last synced: 3 days ago
JSON representation
This Python notebook provides a comprehensive analysis of time series data using different machine learning models. 🔰 What is it about?
- Host: GitHub
- URL: https://github.com/alejo1630/time_series_analysis
- Owner: alejo1630
- Created: 2024-05-21T21:07:32.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T22:16:56.000Z (7 months ago)
- Last Synced: 2024-11-08T07:47:32.336Z (about 2 months ago)
- Topics: forecasting, notebook-jupyter, python, time-series-analysis
- Language: Jupyter Notebook
- Homepage:
- Size: 3.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Time_series_analysis
This Python notebook provides a comprehensive analysis of time series data using different machine learning models.
## 🔰 What is it about?
The dataset used contains monthly milk production from January 1962 to December 1975. The analysis includes exploratory data analysis, feature engineering, and forecasting using **XGBoost**, **LSTM**, and **Darts** models. It also compares the performance of these models based on RMSE metric.
These are the main insights:
*Forecasting 12 months*
All three models capture the overall trend accurately, including the rise in production from January to May and the decline thereafter. XGBoost provides smoother predictions with less variance, often underestimating troughs and overestimating peaks. LSTM captures the seasonal pattern more closely but with slight lag, while Darts, although following the trend well, tends to overestimate both peaks and troughs. Overall, XGBoost offers stable predictions, LSTM balances trend and variance well, and Darts is highly sensitive to changes, making each model suitable for different forecasting needs.
*Forecasting performance based on RMSE for more months (12-74)*
Darts consistently shows the lowest and most stable RMSE across all horizons, indicating robust performance irrespective of the prediction length. XGBoost starts with low RMSE for shorter horizons but its error increases significantly beyond 36 months, reflecting a decrease in accuracy for long-term predictions. LSTM, on the other hand, shows a steady increase in RMSE with the prediction horizon, indicating that its accuracy degrades more gradually over time compared to XGBoost. This suggests that while Darts excels in consistent performance, XGBoost is better suited for short-term predictions, and LSTM offers a balanced approach but is less effective for long-term forecasting.