Member-only story
Deployment of Machine learning Model Demystified (Part 2)
This is the second part in a two-part series. you should read the first part first
The first goal here is to convert the notebook into production-ready code which is nothing but writing pythonic scripts and modules.
Notebooks can be written in jupyter lab, Jupyter notebook, Google Colab etc in which one can also write scripts as well but I have chosen VS-Code as my favourite IDE which is what I will be using for this purpose. Whichever IDE you are using does not really matter.
As part of the setup required when it comes to writing production code, it is a good standard practice to always have a different virtual environment for each project to avoid dependencies issues. This can be created and activated in the command line using the commands below haven navigated to your project root folder:
python -m venv name_of_your_virtual_environment
#activate the environment
name_of_your_virtual_environment\Scripts\activate
#all project dependencies can now be installed
The project dependencies can be installed with a single command when listed in a requirement.txt file with the example…