Skip to content

Balogunhabeeb14/Powerbox

Repository files navigation

PowerBox ML Prediction Service

A machine learning service for predicting power consumption patterns using FastAPI.

Project Structure

powerbox/

├── ML_Opensource_data/ #Opensource data we early sourced that looks mimicks Nigeria features like weathers etc
│   ├── Prophet #facebook prophet model
│   ├── arima          # arima statistical model
│   └── lightGBM       # lightgbm model
│   └── SARIMAX       #  SARIMAX model
│   └── xgboost       # xgboost model
│   └── script       # script to try the different model
├── ML_powerbox_data/ #data gotten from the actual powerbox unit and used for development and deployment using FAST
│   ├── __init__.py
│   ├── api.py          # FastAPI endpoints for predictions
│   └── ML.py           # ML model and prediction logic
├── ETL/
│   └── Dashboard/
│       └── dashboard.py # Data visualization dashboard
├── models/             # Saved model files
└── requirements.txt

Features

  • Real-time power consumption predictions
  • RESTful API endpoints using FastAPI
  • Random Forest Regressor model
  • Interactive dashboard for data visualization

API Endpoints

POST /predict

Predicts power consumption based on input parameters:

  • temperature
  • solar_output
  • battery_energy
  • system_load
  • hour
  • day
  • month
  • day_of_week
  • is_weekend

GET /model-info

Returns model metadata and features list

Quick Start

  1. Install dependencies:
pip install -r requirements.txt
  1. Start the API server:
uvicorn ML_powerbox_data.api:app --reload
  1. Access the API documentation:
http://localhost:8000/docs

Example Request

import requests

data = {
    "temperature": 25.0,
    "solar_output": 1000.0,
    "battery_energy": 5.0,
    "system_load": 2.5,
    "hour": 14,
    "day": 1,
    "month": 6,
    "day_of_week": 2,
    "is_weekend": 0
}

response = requests.post("http://localhost:8000/predict_consumption", json=data)
prediction = response.json()["predicted_consumption"]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages