This project is a web application that visualizes historical CO2 levels and predicts future CO2 levels using a SARIMA model. The application is built using Dash and Plotly for the web interface and visualization, and uses a pre-trained SARIMA model for predictions.
-
Clone the repository:
git clone https://github.com/yourusername/co2-prediction-dashboard.git cd co2-prediction-dashboard
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Train the SARIMA model: Ensure that your historical CO2 data is available in
data/raw/co2_data.csv
. Then run the model training script:python models/sarima_model.py
-
Run the dashboard: Start the Dash application to visualize the historical and predicted CO2 levels:
python webapp/dashboard.py
-
Open the dashboard: Open your web browser and navigate to
http://127.0.0.1:8050/
to view the dashboard.
co2-prediction-dashboard/ │ ├── data/ │ └── raw/ │ └── co2_data.csv │ ├── models/ │ ├── sarima_model.py │ ├── sarima_model.pkl │ └── scaler.pkl │ ├── utils/ │ └── data_preprocessing.py │ ├── webapp/ │ └── dashboard.py │ ├── requirements.txt └── README.md Feel free to customize this README.md as needed for your project.
The historical CO2 data should be placed in the data/raw/co2_data.csv
file. The data should have a datetime
column for the date and a value
column for the CO2 levels.
The SARIMA model is trained using the script in models/sarima_model.py
. This script preprocesses the data, splits it into training and validation sets, trains the SARIMA model, and saves the trained model and scaler.
The dashboard is implemented in webapp/dashboard.py
. It loads the historical data and the trained SARIMA model, makes predictions, and visualizes both the historical and predicted CO2 levels using Plotly.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.