✴️Creating ML Model inside Docker Container …!! 🐋

† † † † † † † † † † † † † † † † † † † † †† † † †† † † †† † † †† † † †† † † †† † † †

💫 What is Machine Learning ?

👉 Machine learning (ML) is the concept in which machine can learn new things like human beings…,by giving power of intelligence to it. And that power is given by a programmer to the machine.

💫 What is Docker..?

👉 Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers are isolated from one another and bundle their own software, libraries and configuration files, they can communicate with each other through well-defined channels.

Task Description … 📃

➡️ Pull the Docker container image of CentOS image from Docker Hub and create a new container
➡️ Install the Python software on the top of docker container

➡️ In Container you need to deploy machine learning model

Let’s Start ….😃🙌
Step 1: Install Docker

I] Configure yum for Docker :

Create a file “/etc/yum.repos.d/docker.repo”[docker]name=docker repo

When it’s done.., verify by “yum repolist". You see some more software.

II] Install Docker and start service :

# Install Docker

yum install docker-ce -- noblest -y

# To start docker service

systemctl start docker

# To enable docker service

systemctl enable docker

Step 2: Pull centos image

docker pull centos:latest

Step 3: Launch a container

docker run -it - -name <name_of_OS> centos: latest

Step 4: Install Python36

yum install python36
# Install required libraries

pip3 install pandas

pip3 install scikit-learn

Step 5: Create a Docker image with commit

docker commit <os_name> <image_name>:<version>

Step 6: Launch a container using that image

docker run -it --name<name><image_name_: version>

To verify use “docker images" command

docker images

Step 7: Copy the dataset which we want to work on

```docker cp<location_in_local> <docker_os_name>:<location_in_docker_container>

To verify is it copied or not check inside the docker container


Step 8: Create Linear Regression Model

Step 9: Let’s check our model
The output of our machine learning model is

Thanks for Reaching here…,

🌈 Keep Learning and Keep Sharing…😃✌️



Computer Engineer 👩🏼‍💻

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store