Sign inSign up

mohdmusheer/ev-efficiency-predictor

By mohdmusheer

β€’Updated 8 months ago

FastAPI-based Machine Learning app to predict Electric Vehicle efficiency (High/Low) EV parameters.

Image
API management
Machine learning & AI
Data science
0

3.6K

mohdmusheer/ev-efficiency-predictor repository overview

⚑ EV Efficiency Predictor – Dockerized FastAPI ML App

This project is a Machine Learning–powered Electric Vehicle (EV) Efficiency Predictor, built using FastAPI, Scikit-learn, and Docker.

It predicts whether an electric vehicle configuration will have High or Low efficiency based on multiple technical, performance, and safety parameters.

The application includes:

A trained ML classification model

A FastAPI backend API

A modern HTML frontend UI

Full Docker support for easy deployment

🧠 Features

πŸš— Predict EV efficiency (High / Low)

⚑ Uses real EV parameters (battery, range, charging, speed, safety)

πŸš€ FastAPI backend with CORS enabled

πŸ“Š Scikit-learn trained classifier

🌐 Interactive web UI

🐳 Fully Dockerized (production-ready)

πŸ› οΈ Tech Stack

Backend: FastAPI, Pydantic

ML: Scikit-learn, Pandas, Joblib

Frontend: HTML/CSS/JavaScript

Deployment: Docker, Uvicorn

Python Version: 3.11

πŸ“‚ Project Structure (Important for Users)
.
β”œβ”€β”€ api/
β”‚ └── api.py # FastAPI app
β”œβ”€β”€ model/
β”‚ └── ev_efficiency_classifier.pkl
β”œβ”€β”€ UI/
β”‚ └── index.html # Frontend UI
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Dockerfile └── README.md

▢️ How to Use This Image (Docker Commands) πŸ”Ή 1. Pull the Image from Docker Hub docker pull musheer/ev-efficiency-predictor

πŸ”Ή 2. Run the Container docker run -d -p 8000:8000 musheer/ev-efficiency-predictor

πŸ”Ή 3. Open in Browser

Web UI: πŸ‘‰ http://localhost:8000⁠

API Docs (Swagger): πŸ‘‰ http://localhost:8000/docs⁠

πŸ”— API Usage Endpoint POST /predict

Example JSON Payload { "manufacturer": "Tesla", "model": "Model 3", "type": "Sedan", "drive_type": "RWD", "fuel_type": "Electric", "color": "White", "fast_charging": "Yes", "country": "USA", "city": "San Francisco", "battery_kwh": 60, "range_km": 450, "charging_time_hr": 1.2, "release_year": 2023, "seats": 5, "acceleration_0_100_kmph": 5.8, "top_speed_kmph": 225, "warranty_years": 8, "cargo_space_liters": 425, "safety_rating": 5 }

Response { "prediction": 1 }

1 β†’ High Efficiency

0 β†’ Low Efficiency

🐳 Dockerfile Used FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["uvicorn", "api.api:app", "--host", "0.0.0.0", "--port", "8000"]

🎯 Ideal For

Machine Learning Internships

FastAPI + ML demos

Docker & DevOps practice

Resume & portfolio projects

College & capstone submissions

Tag summary

Content type

Image

Digest

sha256:b6a6f44e3…

Size

194.7 MB

Last updated

8 months ago

docker pull mohdmusheer/ev-efficiency-predictor