\n\u003C!-- /wp:separator -->\n\n\u003C!-- wp:heading -->\n\u003Ch2 id=\"h-an-example-of-machine-learning-deployment\">An example of machine learning deployment\u003C/h2>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Now, I’m going to walk you through a sample ML project. In this project,you’re an ML engineer working on a promising project, and you want to design a fail-proof system that can effectively put, monitor, track, and deploy an ML model. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Consider \u003Cstrong>Adstocrat\u003C/strong>, an advertising agency that provides online companies with efficient ad tracking and monitoring. They have worked with big companies and have recently gotten a contract to build a machine learning system to predict if customers will click on an ad shown on a webpage or not. The contractors have a large volume dataset in a Google Cloud Storage (GCS) bucket and want Adstocrat to develop an end-to-end ML system for them. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>As the engineer in charge, you have to come up with a design solution before the project kicks off. To approach this problem, ask each of the questions asked earlier and develop a design for this end-to-end system. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading {\"level\":3} -->\n\u003Ch3 id=\"h-data-concerns\">Data concerns\u003C/h3>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>First, let’s talk about the data. \u003Cstrong>How is your training data stored?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>The data is stored in a GCS bucket and comes in two forms. The first is a CSV file describing the ad, and the second is the corresponding image of the ad. The data is already in the cloud, so it may be better to build your ML system in the cloud. You’ll get better latency for I/O, easy scaling as data becomes larger (hundreds of gigabytes), and quick setup and configuration for any additional GPUs and TPUs. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Cstrong>How large is your data?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>The contractor serves millions of ads every month, and the data is aggregated and stored in the cloud bucket at the end of every month. So now you know your data is large (hundreds of gigabytes of images), so your hunch of building your system in the cloud is stronger. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Cstrong>How will you retrieve the data for training?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Since data is stored in the GCS bucket, it can be easily retrieved and consumed by models built on the Google Cloud Platform. So now you have an idea of which cloud provider to use.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Cstrong>How will you retrieve data for prediction?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>In terms of inference data, the contractors informed you that inference will be requested by their internal API, as such data for prediction will be called by a REST API. This gives you an idea of the target platform for the project. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading {\"level\":3} -->\n\u003Ch3 id=\"h-frameworks-and-tools-for-the-project\">Frameworks and tools for the project\u003C/h3>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>There are many combinations of tools you can use at this stage, and the choice of one tool may affect the others. In terms of programming languages for prototyping, model building, and deployment, you can decide to choose the same language for these three stages or use different ones according to your research findings. For instance, Java is a very efficient language for backend programming, but cannot be compared to a versatile language like Python when it comes to machine learning. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>After consideration, you decide to use Python as your programming language, Tensorflow for model building because you will be working with a large dataset that includes images, and Tensorflow Extended (TFX), an open-source tool released and used internally at Google, for building your pipelines. What about the other aspects of the model building like model analysis, monitoring, serving, and so on? What tools do you use here? Well, TFX pretty much covers it all!\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>TFX provides a bunch of frameworks, libraries, and components for defining, launching, and monitoring machine learning models in production. The components available in TFX let you build efficient ML pipelines specifically designed to scale from the start. These components has built-in support for ML modeling, training, serving, and even managing deployments to different targets.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:image -->\n\u003Cfigure class=\"wp-block-image\">\u003Cimg src=\"https://lh5.googleusercontent.com/mN9NBby0bY2DBz7JPqqwyFcKa6wvJGxu4M1f8oHaBSfSH0HwaFi_UC2vYexVXNrXfToF_lHLfcht8OphdU91qpEfLkSH-g_WiDV3VGgRvqfiZ8tCcaW03DaFXjPyL2uPHpfTbYPI\" alt=\"\"/>\u003C/figure>\n\u003C!-- /wp:image -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>TFX is also compatible with our choice of programming language (Python), as well as your choice of deep learning model builder (Tensorflow), and this will encourage consistency across your team. Also, since TFX and Tensorflow were built by Google, it has first-class support in the Google Cloud Platform. And remember, your data is stored in GCS. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>If you want the technical details on how to build a complete end-to-end pipeline with TFX, see the links below:\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Ca href=\"https://www.tensorflow.org/tfx\">\u003Cstrong>TensorFlow Extended (TFX) | ML Production Pipelines\u003C/strong>\u003C/a>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Ca href=\"https://www.tensorflow.org/tfx\">\u003Cem>Build and manage end-to-end production ML pipelines. TFX components enable scalable, high-performance data processing…\u003C/em>www.tensorflow.org\u003C/a>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Ca href=\"https://blog.tensorflow.org/search?label=TFX&max-results=20\">\u003Cstrong>The TensorFlow Blog\u003C/strong>\u003C/a>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Ca href=\"https://blog.tensorflow.org/search?label=TFX&max-results=20\">\u003Cem>Creating Sounds Of India: An on device, AI powered, musical experience built with TensorFlow August 14, 2020 - Posted…\u003C/em>blog.tensorflow.org\u003C/a>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Cstrong>Are the choice of tools open-source or closed?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Python and TFX and Tensorflow are all open-source, and they are the major tools for building your system. In terms of computing power and storage, you are using all GCP which is a paid and managed cloud service. This has its pros and cons and may depend on your use case as well. Some of the pros to consider when considering using managed cloud services are:\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:list -->\n\u003Cul>\u003C!-- wp:list-item -->\n\u003Cli>They are cost-efficient\u003C/li>\n\u003C!-- /wp:list-item -->\n\n\u003C!-- wp:list-item -->\n\u003Cli>Quick setup and deployment\u003C/li>\n\u003C!-- /wp:list-item -->\n\n\u003C!-- wp:list-item -->\n\u003Cli>Efficient backup and recovery\u003C/li>\n\u003C!-- /wp:list-item -->\u003C/ul>\n\u003C!-- /wp:list -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Some of the cons are:\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:list -->\n\u003Cul>\u003C!-- wp:list-item -->\n\u003Cli>Security issue, especially for sensitive data\u003C/li>\n\u003C!-- /wp:list-item -->\n\n\u003C!-- wp:list-item -->\n\u003Cli>Internet connectivity may affect work since everything runs online\u003C/li>\n\u003C!-- /wp:list-item -->\n\n\u003C!-- wp:list-item -->\n\u003Cli>Recurring costs\u003C/li>\n\u003C!-- /wp:list-item -->\n\n\u003C!-- wp:list-item -->\n\u003Cli>Limited control over tools\u003C/li>\n\u003C!-- /wp:list-item -->\u003C/ul>\n\u003C!-- /wp:list -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>In general, for smaller businesses like startups, it is usually cheaper and better to use managed cloud services for your projects. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Cstrong>How many platforms/targets support the tool?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>TFX and Tensorflow run anywhere Python runs, and that’s a lot of places. Also, models built with Tensorflow can easily be saved and served in the browsers using\u003Ca href=\"https://www.tensorflow.org/js/\"> Tensorflow.js\u003C/a>, in mobile devices and IoT using\u003Ca href=\"https://www.tensorflow.org/lite/\"> Tensorflow lite\u003C/a>, in the\u003Ca href=\"https://www.tensorflow.org/tfx/\"> cloud\u003C/a>, and even on-prem.\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading {\"level\":3} -->\n\u003Ch3 id=\"h-feedback-and-iteration-concerns\">Feedback and Iteration concerns\u003C/h3>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>\u003Cstrong>How do we get feedback from a model in production?\u003C/strong>\u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>TFX supports a feedback mechanism that can be easily used to manage model versioning as well as rolling out new models. Custom feedback can be built around this tool to effectively track models in production. A TFX Component called\u003Ca href=\"https://www.tensorflow.org/tfx/guide/tfma\"> \u003Cstrong>TensorFlow Model Analysis (TFMA)\u003C/strong>\u003C/a>\u003Cstrong> \u003C/strong>allows you to easily evaluate new models against current ones before deployment. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Looking back at the answers above, you can already begin to picture what your final ML system design will look like. And getting this part before model building or data exploration is very important. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:heading -->\n\u003Ch2 id=\"h-conclusion\">Conclusion\u003C/h2>\n\u003C!-- /wp:heading -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Effectively putting an ML model in production does not have to be hard if all the boxes are ticked before embarking on a project. This is very important in an ML project you’ll embark on and should be prioritized! \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>While this post is not exhaustive, I hope it has provided you with a guide and intuition on how to approach an ML project to put it in production. \u003C/p>\n\u003C!-- /wp:paragraph -->\n\n\u003C!-- wp:paragraph -->\n\u003Cp>Thanks for reading! See you again another time. \u003C/p>\n\u003C!-- /wp:paragraph -->","html","2020-10-12T13:25:08.000Z",{"current":1028},"how-to-put-machine-learning-models-into-production",[1030,1038,1043,1048],{"_createdAt":1031,"_id":1032,"_rev":1033,"_type":1034,"_updatedAt":1031,"slug":1035,"title":1037},"2023-05-23T16:43:21Z","wp-tagcat-code-for-a-living","9HpbCsT2tq0xwozQfkc4ih","blogTag",{"current":1036},"code-for-a-living","Code for a Living",{"_createdAt":1031,"_id":1039,"_rev":1033,"_type":1034,"_updatedAt":1031,"slug":1040,"title":1042},"wp-tagcat-data-science",{"current":1041},"data-science","data science",{"_createdAt":1031,"_id":1044,"_rev":1033,"_type":1034,"_updatedAt":1031,"slug":1045,"title":1047},"wp-tagcat-machine-learning",{"current":1046},"machine-learning","machine learning",{"_createdAt":1031,"_id":1049,"_rev":1033,"_type":1034,"_updatedAt":1031,"slug":1050,"title":1051},"wp-tagcat-tensorflow",{"current":1051},"tensorflow","How to put machine learning models into production",[1054,1060,1066,1072],{"_id":1055,"publishedAt":1056,"slug":1057,"sponsored":12,"title":1059},"f0807820-02d7-4fc5-845f-3d76514b81c0","2025-08-11T16:00:00.000Z",{"_type":10,"current":1058},"renewing-chat-on-stack-overflow","Renewing Chat on Stack Overflow ",{"_id":1061,"publishedAt":1062,"slug":1063,"sponsored":12,"title":1065},"e33464c4-b21b-4019-8b86-64a46335a95e","2025-08-07T16:00:00.000Z",{"_type":10,"current":1064},"a-new-worst-coder-has-entered-the-chat-vibe-coding-without-code-knowledge","A new worst coder has entered the chat: vibe coding without code knowledge",{"_id":1067,"publishedAt":1068,"slug":1069,"sponsored":12,"title":1071},"8b04b236-51d5-4747-9de8-2fe6e6a2512e","2025-08-04T16:00:00.000Z",{"_type":10,"current":1070},"cross-pollination-as-a-strategic-advantage-for-forward-thinking-organizations","Cross-pollination as a strategic advantage for forward-thinking organizations",{"_id":1073,"publishedAt":1074,"slug":1075,"sponsored":12,"title":1077},"5bddfa7a-32ce-4f9b-9919-10f03a9ef39b","2025-07-31T16:00:00.000Z",{"_type":10,"current":1076},"do-ai-coding-tools-help-with-imposter-syndrome-or-make-it-worse","Do AI coding tools help with imposter syndrome or make it worse?",{"count":1079,"lastTimestamp":1080},16,"2025-05-27T14:54:36Z",["Reactive",1082],{"$sarticleModal":1022},["Set"],["ShallowReactive",1085],{"sanity-KwM7RN6sCcGpJ52YfzBlNiB_bJUsY1tBi0hiWgpoVEs":-1,"sanity-comment-wp-post-16751-1755411911146":-1},"/2020/10/12/how-to-put-machine-learning-models-into-production/?cb=1"]