"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

February 03, 2020

ML Model Hosting, Deployment

ML Model Hosting
This post is to discuss different techniques for Model hosting. The real-world scenario will involve
  • Data Pipeline
  • Model Training
  • Model Deployment (Saved File / Saved Coefficients and compute at runtime)
  • Model Rendering
  • Framework for monitoring model performance
  • Model Retraining
Data pipeline would be the data obtained from transactional / BI systems
Model Training would involve pre-processing, normalization, bucketing and multiple features. This is like metadata. This needs to be stored in a metadata table or a separate standalone script to apply for the test data
Model deployment - Save the model as pickle file / Save the coefficient values in DB with metadata value to compute
Model Rendering - Exposure as a Service, Invoke this after a service call
Monitoring model performance - Expected / Actual values need to be monitored, deviation beyond a certain threshold would need human in loop to update / re-train / fix the model
Model Retraining - Model has to be updated on a regular basis or deviation from certain threshold accuracy

Tools -
Flask API, Web Interface, Visualization of Clusters, Recommendations, SQL Code/ Python code for preparing feature variables, Handling Missing data, normalization (standard code), Logging, Model monitoring schema


References
Click Prediction ML Software Pipelines from the Trenches
Architecting a Machine Learning Pipeline
Machine Learning Pipeline from scratch
Models to Production
How to Code Neat Machine Learning Pipelines
Lessons learnt while building a Machine Learning Pipeline
Cookiecutter Data Science
production-data-science

Happy Learning!!!

No comments: