Skip to content

illuminzcode/acTemperature-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# 🧠 Smart AC Temperature Predictor (AI-Driven)

This project uses machine learning to recommend optimal AC temperature settings based on:
- Number of people in the room
- Number of AC units
- Total power of AC units

It provides a FastAPI interface to:
- Train the model with new data
- Analyze crowd data and return recommended AC temperature

---

## πŸš€ Features

- βœ… FastAPI endpoints for training and prediction
- βœ… Uses `SGDRegressor` for incremental learning (`partial_fit`)
- βœ… Saves and loads model using `joblib`
- βœ… Input validation and safe defaults
- βœ… Real-time model improvement with feedback loop

---

## 🧩 Example Use Case

A smart building system tracks:
- Room occupancy
- AC specs (count and total wattage)

And automatically adjusts the AC temperature setting via this API.

---

## πŸ“¦ Tech Stack

- Python 3.10+
- FastAPI
- scikit-learn (SGDRegressor)
- joblib
- Uvicorn

---

## πŸ“ Project Structure

acTemperature/ 
β”œβ”€β”€ ac_temp_ai.py # Main FastAPI app 
β”œβ”€β”€ model.joblib # Trained ML model 
β”œβ”€β”€ requirements.txt # Python dependencies 
└── README.md # This file


/analyze β€” Predict recommended temperature
POST /analyze
{
  "num_people": 15,
  "num_ac": 3,
  "total_ac_power": 4500
}

Response:
{
  "recommended_temp_setting": 21.5,
  "ac_suggestion": "AC setup is sufficient."
}

πŸ› οΈ Setup Instructions

# 1. Clone the repo
git clone https://github.com/illuminzcode/acTemperature-ai.git
cd acTemperature-ai

# 2. Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Run the server
uvicorn ac_temp_ai:app --reload

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages