🧾 Project Prompt (Assignment)
Crea una API en Python que utilice un modelo entrenado para hacer predicciones.
La API recibe datos y devuelve resultados.
Stakeholders want your classifier available via an API so other apps can use it.
Expose your trained model as a versioned API with a /predict endpoint.
Requirements
- Load the model artifact on startup
- Validate the request schema (Pydantic)
- Return prediction + probability/confidence
- Add versioning:
/v1/predict
- Add
/health endpoint
- Add request logging (request id, latency)
- Add tests for predict (valid + invalid payloads)
🛠Tools (Tech Stack)
- Python + FastAPI + Uvicorn
- scikit-learn (or your chosen model)
- Pydantic
- Pytest
💡 Implementation Hints
- Keep preprocessing identical to training (Pipeline)
- Don’t reload the model per request (load once)