Back to Course
Machine Learning: The Engineering Approach
Module 5 of 13
5. Deployment with FastAPI
1. Pickle
Saving your Python object to a file.
pythonimport joblib joblib.dump(model, "model.pkl")
2. API
Serving predictions via HTTP.
pythonfrom fastapi import FastAPI import joblib app = FastAPI() model = joblib.load("model.pkl") @app.post("/predict") def predict(features: list): return model.predict([features]).tolist()