This FastAPI-based machine learning API predicts breast cancer recurrence based on structured clinical features. It uses a versioned model architecture to support future model upgrades without breaking compatibility.
- 🔐 JWT-secured endpoints
- 📊 XGBoost-based recurrence classification
- 🔄 Model versioning via
/predecir/predictand/predecir/meta - 🧠 Input validation with categorical encoders
- 📤 Metadata endpoint to expose model expectations
- 📦 Auto-token refresh Postman collection
predecir-api/
├── main.py
├── model/
│ └── v1/
│ ├── model.pkl
│ └── encoders/
├── routers/
│ └── v1/
│ └── prediction.py
├── entity/
│ └── recurrence_input.py
├── auth/
│ └── auth_handler.py
├── utils/
│ └── logging_config.py
├── core/
│ └── config.py
├── postman/
│ └── BreastCancerRecurrenceAPI_v1.postman_collection.json
└── .env.example
pip install -r requirements.txt
uvicorn main:app --reloadSet up a
.envfile using.env.example.
- Use
/tokento get JWT token (username/password in env) - Pass token in
Authorization: Bearer <token>header
POST /predecir/predict- Make a predictionGET /predecir/meta- Get valid field valuesPOST /predecir/token- Get access token
Import the Postman collection from /postman folder. Includes auto-refreshing token setup.
MIT License (c) 2025 Carealytica