Spaces:
Sleeping
Sleeping
metadata
title: GreenPrint AI
emoji: 🚀
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
- streamlit
pinned: false
short_description: A futuristic take on carbon footprint + AI.
🌿 GreenPrint AI
A futuristic take on carbon footprint + AI.
Overview
GreenPrint AI is a user-friendly web app that predicts your carbon footprint based on daily activities and suggests actionable steps to reduce it. From energy consumption to travel and food habits, the app personalizes insights using machine learning.
Aim
To develop a carbon footprint detection system that:
- Takes input as user activities (e.g., electricity use, transport habits, meat consumption).
- Predicts the carbon footprint in kilograms of CO₂ equivalent.
- Recommends practical, low-carbon alternatives.
Step-by-Step Project Workflow
Step 1: Dataset Creation
- A synthetic dataset named
synthetic_carbon_footprint.csvwas generated using realistic formulas for CO₂ emissions from:- Electricity consumption
- Travel (personal & public)
- Dietary choices (meat)
- Plastic usage
- These were computed using coefficients (e.g., kg CO₂ per kWh, km, gram of meat).
- The script
Creating_Dataset.ipynbcontains the exact formula-based generation logic.
Step 2: Model Training
- Model Used: RandomForestRegressor from scikit-learn
- Training done using
Running_Model.ipynb - Preprocessing involved:
- Feature scaling (
StandardScaler) - Ensuring input columns align with model_columns.pkl
- Splitting dataset into training/testing sets
- Feature scaling (
- Evaluation metrics:
- R² Score for goodness-of-fit
- Root Mean Squared Error (RMSE) for prediction accuracy
- The trained model was saved as
carbon_model.pkl
Why Random Forest Regressor?
- It handles non-linear relationships and interactions between features better than linear models.
- It’s robust to overfitting due to its ensemble nature.
- Outperformed linear models in testing, giving: Higher R² and Lower RMSE
- Offers feature importance insights, useful for explainability in a sustainability context.
Step 3: Feature Metadata Handling
- A
model_columns.pklfile was created to store the expected feature column order. - This prevents column mismatch during inference in the Streamlit frontend.