Setting up environment for machine learning operations

INSTALLATIONS

Setting up of environment for machine learning operations can sometime be tiring and at the same time it worth it. There are numerous difficulties one can encounter why performing this process. One is conflict in libraries due to variation in versions and all of that. Thus, thorough attention is needed for this operation. Depending on the platform one is comfortable with MLOps environments can be set using visual studio code, terminal, cloud platform, code spaces etc. I’m certain we all know what visual studio code is, otherwise, visual studio code can be downloaded from the link below depending on your operating system:

click to download visual studio

Moving forward, using Linus or Windows terminal, this can be tricky to comprehend but then its look more professional, also, cloud platforms like Amazon Web Service (AWS), Google Cloud Platform (GCP) and Microsoft Azure can be applied for environmental setup for machine learning operations. Let get right into it:

Linux environment operating system is an open-source OS which support user customization and it is unique because of its resistance to attack which implies that it is more secured. For users with window operating system see my blog post on how to instal Linux on your local machine (Link here). From your Linux terminal, download anaconda, you can download anaconda from the following link

click to download anaconda

You will go ahead and fill in your mail then proceed to download. NOTE: you will copy the Linux download URL and use “wget” to download the software via your Linux terminal. Updating your Linux software is very important in fact it is ideal to update it before downloading any software in your Linux machine. You can simply do this by typing sudo apt update in your linux terminal. Moving forward, after successful download of your anaconda software you can simply install it by typing bash then click enter.

Proceed to the download of Docker using: sudo apt install docker.io

Install docker compose Proceed to search docker compose github on google search engine. Then click the main repository for docker compose or you can simply click on this link

click to download docker compose

Click on latest from the repository, then proceed to the copy of docker compose url as seen here for linux operating system.

copy this link

goto your linux terminal create a folder say “comp” by simply typing mkdir comp in your linux terminal. Navigate into the folder by typing cd comp in your linux terminal. Then proceed to the download of your docker compose using wget copied_link However, to make it executable simply execute the code below in your terminal Chmod +x docker-compose You can go ahead and confirm your docker installation by simply executing the code below Sudo docker run hello-world. Go ahead and create a text file name requirements.txt using nano requirements.txt edit the file by inserting all the libraries required for your machine learning operations. Libraries like: pandas numpy mlflow seaborn hyperopt scikit-learn Xgboost Save the file and confirm it by executing Cat requirements.txt In your terminal you can simply install all the modules in the requirement.txt by simply executing Pip install -r requirements.txt Following all these steps sequentially you have successfully setup your environment for MLOps and you can start building your models for deployment. If you can recall you will notice that this tutorial only focuses on terminal installation using Linux terminal. We can also attempt the installation using codespace from GitHub this is kind of better for people with low RAM storage on their local machine as codespace can provide you with upto 16GIG RAM storage. However, I will put you through on how to go about this in the next tutorial.

Linux terminal

MLFLOW UI