Posts

Showing posts from July 5, 2024

[Day 186] Prefect cloud, model serving with FastAPI, and SHAP values

Image
 Hello :) Today is Day 186! A quick summary of today: using FastAPI for model serving, and running it in Docker starting to think about model monitoring All code, pictures are on my github repo . Firstly, yesterday I was having version issues between prefect and prefect-gcp - fixed that with the help of Prefect's community slack, and now I can run one file which runs both flows - upload_to_gcs flow and train_model flow. I also realised that for solo (and mini project) devs Prefect cloud is free, so I uploaded my flows to there just to be a bit safer - not having everything locally only.  The UI is the same, but it is in the cloud.  Next, serving the model for inference I decided to use FastAPI as it seems very easy to create and run a server. Also when I run a fastapi server, there is a nice /docs page where I can quickly and easily test my endpoints.  It is pretty basic for now, and I just need to improve the prefict_fraud function. I also set up the server to run in docker. Again