This folder contains notebooks to perform perliminary data analysis and time-series forecasting with machine learning using Python.
To work with the repository, one can simply clone it in the local machine:
git clone "https://github.com/andreabellome/time_series_forecasting"
If one wants to specify a specific target directory (should be empty):
git clone "https://github.com/andreabellome/time_series_forecasting" /path/to/your/target/directory
where /path/to/your/target/directory
should be replaced with the desired local taregt directory.
The toolbox requires Python version 3.10 or above. The toolbox uses common Python libraries: numpy, scipy, matplotlib and plotly. If not already downloaded, please use pip to do so:
pip install numpy, scipy, matplotlib, plotly
Moreover, machine-learning-specific libraries are required: lightgbm for the regression models, skforecast for the Bayesian search and shap for interpreting the results. These can be installed using pip as well:
pip install lightgbm, skforecast, shap
Any version of Jupyter is also required.
The work is under license CC BY-NC-SA 4.0, that is an Attribution Non-Commercial license. One can find the specifics in the LICENSE file.
Only invited developers can contribute to the repository.
Two main files can be used to run the forecast analysis:
- A Jupiter notebook that describes step-by-step the data analysis, preparation and forecast performed.
- A small web-app that can be run in local machine that does the same analysis of the notebook but for a more user-friendly interface.
A notebook is provided that is notebook_power_load_forecasting.ipynb. This is self-explanatory, and the interested developer is encouraged to explore the code.
To run the notebook, one needs to have the Jupyter.
pip install jupyter
The script to run the web-app is app.py. To run this script, one needs to have streamlit installed:
pip install streamlit
Then, one should open a terminal window inside the time_series_forecasting
folder. To start the web-app, just write to terminal:
streamlit run app.py
The web-app uses pre-trained parameters saved in the variable forecaster_params.pkl. One can generate new ones using desired lags and steps using the notebook.
Happy coding!