𝐃𝐞𝐩𝐥𝐨𝐲𝐢𝐧𝐠 𝐌𝐚𝐜𝐡𝐢𝐧𝐞 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐦𝐨𝐝𝐞𝐥 𝐢𝐧𝐬𝐢𝐝𝐞 𝐃𝐨𝐜𝐤𝐞𝐫 𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫

𝐃𝐞𝐩𝐥𝐨𝐲𝐢𝐧𝐠 𝐌𝐚𝐜𝐡𝐢𝐧𝐞 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐦𝐨𝐝𝐞𝐥 𝐢𝐧𝐬𝐢𝐝𝐞 𝐃𝐨𝐜𝐤𝐞𝐫 𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫

TASK-1

𝑻𝒂𝒔𝒌 𝑫𝒆𝒔𝒄𝒓𝒊𝒑𝒕𝒊𝒐𝒏📝

 👉 Pull the Docker container image of CentOS image from DockerHub and create a new container

👉 Install the Python software on the top of docker container

👉 In Container you need to copy/create machine learning model which you have created in jupyter notebook



Machine Learning:

Machine Learning is a part of Artificial Intelligence that focuses on the study of computing and mathematical algorithms and data sets to make decisions without writing manual code. In other words, machine learning is writing code that lets machines make decisions based on pre-defined algorithms on provided datasets.

Step 1

Check the status of Docker using command:

"systemctl status docker"

No alt text provided for this image

 Step 2

 Pull the Docker container image of CentOS image from DockerHub using command :

"docker pull centos:latest"

 Pulling from library/centos

No alt text provided for this image

Step 3

 Creating a new container and launching it

     "Docker run –it - -name Task1 centos:latest"

 Here, Task1 is the name of the container

No alt text provided for this image

Step 4

 Installing python3

Command: "yum install python3 –y"

No alt text provided for this image

Step 5

 Installing libraries of python

1. Install pandas:

"pip3 install pandas"

No alt text provided for this image

Step 6

 2. Install sklearn:

"pip3 install sklearn"

No alt text provided for this image

Step 7

 Creating a directory in the container to copy the ML model which we have created in jupyter notebook

No alt text provided for this image

Step 8

 In base OS, To copy the ML model we run the following command

"Docker cp /root/Documents/ML/model_name container_name:/path"

No alt text provided for this image

   

Step 9

 By using "ls" command we can see the files which are there in our container

No alt text provided for this image

Step 10

 Use "vi" command to create the text editor file with the extension ".py" and load the model

No alt text provided for this image

Step 11

 By using "python3 model_name.py" command run the python file

No alt text provided for this image

Step 12                                

Enter the experience and it will predict the salary

No alt text provided for this image

Step 13

Model has predicted the salary

No alt text provided for this image

𝐓𝐡𝐚𝐧𝐤 𝐘𝐨𝐮!!

                          

To view or add a comment, sign in

More articles by Chandni Ahuja

Others also viewed

Explore content categories