This repository contains a machine learning project for time series analysis and forecasting using multiple models such as Linear Regression, ARIMA, SARIMA, and PROPHET. The project is implemented in Python and includes Jupyter notebooks for exploratory data analysis (EDA) and a main script (main.py) to run the forecasting analysis.
git clone https://github.com/TJselevani/python-analysis.git
cd python-analysispython3 -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windowspip install -r requirements.txt├── config.py # Configuration file
├── data/ # Directory containing raw data
├── eda/ # Jupyter notebooks for EDA
│ ├── day.ipynb
│ ├── week.ipynb
│ ├── month.ipynb
│ ├── year.ipynb
├── files/ # Directory for storing analysis files
├── main.py # Main script for running forecasting
├── main.ipynb # Jupyter notebook version of the main script
├── utils/ # Helper functions
│ ├── data_preparation/
│ │ ├── prepare_time_series.py
│ ├── ensemble/
│ │ ├── ensemble_forecast.py
│ │ ├── plot_ensemble_forecast.py
│ ├── prediction/
│ │ ├── ensemble_prediction.py
├── requirements.txt # List of dependencies
├── README.md # Project documentation
To run the time series forecasting analysis, execute the main.py script:
python main.pyThis script:
- Loads the dataset from
config.py. - Runs predictions using different models.
- Creates an ensemble forecast.
- Visualizes and prints the forecast for the next 7 days.
The eda/ directory contains Jupyter notebooks for data visualization:
day.ipynb: Analysis at the daily level.week.ipynb: Weekly trends.month.ipynb: Monthly patterns.year.ipynb: Yearly trends.
To run the EDA notebooks:
jupyter notebookThen open the desired notebook from the eda/ directory.
A list of required dependencies is available in requirements.txt. The major dependencies include:
pandasnumpymatplotlibscikit-learnstatsmodelsprophetplotlyjupyterfastapiuvicorn
This project is open-source and available under the MIT License.
For any issues or contributions, feel free to submit a pull request or open an issue in the repository!