🔗 https://load-prediction-9zp5.onrender.com
A machine learning model that predicts power system Load Type (Light / Medium / Maximum) from energy consumption data. Deployed as a FastAPI web service on Render.
Predict the Load_Type of a steel industry power system using historical data. Classification into 3 classes:
- Light_Load
- Medium_Load
- Maximum_Load
- 35,041 rows × 9 columns (Jan–Dec 2018)
- Features:
Usage_kWh,Lagging/Leading Reactive Power,CO2,Power Factors,NSM - Validation: Last month (Dec 2018) as test set (time-based split)
┌────────────┐ ┌────────────────┐ ┌───────────────────┐ ┌────────────────┐ ┌────────────────┐ ┌─────────┐ ┌─────────────────┐ ┌──────────────────┐
│ Raw Data │─▶│ Preprocessing │──▶│ Feature Engineer │─▶│ Outlier Handle │─▶│ Train/Test Split│─▶ │ SMOTE │──▶│ 7 Models Trained│──▶│🏆Stacking Ensem.│
│ (35,041) │ │• Median impute │ │• 31 features │ │• 1st-99th %ile │ │• Time-based │ │ Balance │ │ LR | RF | XGB │ │ Accuracy: 93.95% │
│ │ │• Remove dupes │ │• Time + Cyclical │ │ capping │ │• Last month │ │ classes │ │ LGBM | ET │ │ F1-Score: 93.99% │
│ │ │• CO2 zero fix │ │• Power interact. │ │ │ │ = test set │ │ │ │ Voting|Stacking │ │ │
└────────────┘ └────────────────┘ └───────────────────┘ └────────────────┘ └────────────────┘ └─────────┘ └─────────────────┘ └──────────────────┘
|
Overall Metrics
|
Per-Class Performance
|
├── Assignment2.ipynb # Full EDA + model training notebook
├── train_and_save.py # Script to train & export model artifacts
├── app/
│ ├── main.py # FastAPI app with web UI
│ ├── model.py # Model loading & prediction
│ └── feature_engineering.py # Replicates notebook's feature pipeline
├── models/ # Saved model, scaler, encoder
├── data/load_data.csv # Dataset
├── Dockerfile # Docker build for Render
├── render.yaml # Render deployment config
└── requirements.txt # Dependencies
POST /predict
{
"Date_Time": "01-01-2018 00:15",
"Usage_kWh": 8.75,
"Lagging_Current_Reactive_Power_kVarh": 2.95,
"Leading_Current_Reactive_Power_kVarh": 0.0,
"CO2_tCO2": 0.0,
"Lagging_Current_Power_Factor": 73.21,
"Leading_Current_Power_Factor": 100.0,
"NSM": 900.0
}Response:
{
"predicted_load_type": "Light_Load",
"confidence": 0.9953,
"probabilities": {
"Light_Load": 0.9953,
"Maximum_Load": 0.0012,
"Medium_Load": 0.0035
}
}pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000Open http://localhost:8000 — web UI with sample data for testing.
Python • FastAPI • scikit-learn • XGBoost • LightGBM • Docker • Render
Where This Project Can Go Next
┌──────────────────────────────────────────────────────────────────────────────────┐
│ │
│ SMARTER MODELS MLOps & AUTOMATION EXPLAINABILITY │
│ ───────────────────── ──────────────────────── ─────────────────── │
│ LSTM/Transformers for Auto-retrain on drift SHAP/LIME to show │
│ temporal patterns MLflow model versioning WHY a load type was │
│ (93.95% → higher) CI/CD via GitHub Actions predicted (XAI) │
│ │
│ REAL-TIME & IoT DEMAND FORECASTING MULTI-PLANT │
│ ──────────────────── ─────────────────────── ────────────────── │
│ Kafka/MQTT streaming Predict Usage_kWh ahead Transfer/Federated │
│ Edge deploy (ONNX) Peak shaving & load Learning across │
│ SCADA integration shifting to cut costs multiple facilities │
│ │
│ ANOMALY DETECTION BATCH & CSV UPLOAD PROD HARDENING │
│ ───────────────────── ───────────────────────── ───────────────────── │
│ Flag equipment faults Bulk predictions via JWT auth, rate limits │
│ & energy theft with file upload + interactive Kubernetes scaling │
│ Isolation Forests historical dashboards Grafana monitoring │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘

