Skip to content

Simple ML Project

ML Workflow

Goal

Predict Y from A and B, then determine the class from A, B and Y using Machine Learning models and clustering.


Project structure

.
├── notebooks/
│   └── analysis.ipynb
├── src/
│   ├── train.py
│   └── clustering.py
├── api/
│   └── main.py
├── test.py
├── requirements.txt
└── README.md

Files

  • notebooks/analysis.ipynb : data analysis and exploration
  • src/train.py : train regression models
  • src/clustering.py : train KMeans clustering
  • api/main.py : FastAPI routes
  • test.py : test the API and save predictions

How it works

A + B
   ↓
Regression Model
   ↓
Predicted Y
   ↓
A + B + Y
   ↓
KMeans Clustering
   ↓
Class

Technologies

  • Python
  • pandas
  • scikit-learn
  • FastAPI
  • Uvicorn
  • Jupyter Notebook
  • KMeans

Run

Install dependencies:

pip install -r requirements.txt

Train the regression model:

python src/train.py

Train the clustering model:

python src/clustering.py

Start the API:

uvicorn api.main:app --reload

Run tests:

python test.py

API

Swagger documentation:

http://127.0.0.1:8000/docs

Result

The project provides a complete small Machine Learning workflow:

  • data analysis
  • regression prediction
  • clustering classification
  • API prediction service
  • automated testing

Liens


Auteur

Ahmad Abo-Alola — Student Project (AI Developer Training)