A production-grade machine learning system for Solar PV Power Output Prediction, complete with:
- 🤖 ML Training Pipeline (training_enhanced.py)
- 🌐 FastAPI Prediction Server (server.py)
- 🎨 Modern Streamlit Dashboard (app_enhanced.py)
- 📊 EDA + Model Visualizations
- 🧪 Batch CSV Prediction
- 🔴 Live Digital Twin Simulation
- 📁 Industry-level Project Structure
This Solar PV Digital Twin predicts instantaneous power output (W) using:
- Solar irradiance
- Temperature
- Wind speed
- Humidity
- Plane of array irradiance
- Cell temperature
- Panel tilt & azimuth
The system integrates ML + API + UI to simulate real-world solar plant monitoring, forecasting, and analysis.
| Metric | Value |
|---|---|
| MAE | 0.0 W |
| MAPE | 4.93% |
| R² Score | 0.9982 |
| Max Error | 0.05 W |
Artifacts stored in:
models/pipeline_prod.joblib
models/metrics.json
data/ → preprocessing → training_enhanced.py
↓
models/pipeline_prod.joblib
↓
FastAPI server (server.py)
↓
Streamlit Dashboard (app_enhanced.py)
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txtpython src/training/training_enhanced.pyuvicorn src.server:app --reloadstreamlit run src/app_enhanced.pyJSON → single power output prediction
Upload CSV → returns full predictions CSV/JSON
Health check
Model metadata + metrics
solar-pv-project/
│
├─ data/
├─ models/
│ ├─ pipeline_prod.joblib
│ ├─ metrics.json
│ └─ visualizations/
│
├─ src/
│ ├─ app_enhanced.py
│ ├─ server.py
│ ├─ training/
│ │ └─ training_enhanced.py
│ ├─ inference/
│ └─ utils/
│
├─ tests/
├─ requirements.txt
└─ README.md
- ✔ Pre-commit formatting (Black + Flake8)
- ✔ Configurable training pipeline
- ✔ FastAPI endpoint validation
- ✔ Streamlit modular UI
- ✔ Ready for Docker deployment
- ✔ GitHub-friendly directory structure
Dhruv Bansal
ML Engineer • Dashboard Developer • Final Year EEE
📧 Email: dhruvbansal23731@gmail.com 🌐 GitHub: https://github.com/dbansal0607






